blob: 6ac4c431e1f43a7c003aed94b176b34b1455e0f5 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#!/usr/bin/make -f
2# Made with the aid of dh_make, by Craig Small
3# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4# Some lines taken from debmake, by Cristoph Lameter.
5
6# Uncomment this to turn on verbose mode.
7#export DH_VERBOSE=1
8
9# These are used for cross-compiling and for saving the configure script
10# from having to guess our platform (since we know it already)
11DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14BUILD_CC = gcc
15
16CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
17CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
18
19TARGET = i686-w64-mingw32
20MINGW_BIN = /usr/bin
21MINGW_TOP = /usr/$(TARGET)
22MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses6
23
24CFLAGS = $(CC_NORMAL)
25
26CONFIG_OPTIONS = \
27 --disable-echo \
28 --disable-db-install \
29 --disable-getcap \
30 --disable-hard-tabs \
31 --disable-leaks \
32 --disable-macros \
33 --disable-overwrite \
34 --disable-termcap \
35 --enable-interop \
36 --enable-pc-files \
37 --enable-term-driver \
38 --enable-warnings \
39 --enable-widec \
40 --verbose \
41 --with-abi-version=6 \
42 --with-cxx-shared \
43 --with-develop \
44 --with-fallbacks=unknown,rxvt \
45 --with-shared \
46 --with-trace \
47 --with-xterm-kbs=DEL \
48 --without-ada \
49 --without-debug \
50 --without-manpages \
51 --without-progs \
52 --without-tests
53
54export CFLAGS BUILD_CC
55
56ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
57 CFLAGS += -O0
58else
59 CFLAGS += -O2
60endif
61ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
62 INSTALL_PROGRAM += -s
63endif
64
65configure: configure-stamp
66configure-stamp:
67 dh_testdir
68
69 CC=$(TARGET)-gcc \
70 CFLAGS="$(CFLAGS)" \
71 ./configure \
72 --host=$(TARGET) \
73 --target=$(TARGET) \
74 --prefix=$(MINGW_TOP) \
75 --with-build-cc=$(BUILD_CC) \
76 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \
77 $(CONFIG_OPTIONS)
78
79 touch configure-stamp
80
81build: build-stamp
82build-stamp: configure-stamp
83 dh_testdir
84
85 $(MAKE)
86
87 touch build-stamp
88
89clean:
90 dh_testdir
91 dh_testroot
92
93 [ ! -f makefile ] || $(MAKE) distclean
94
95 rm -f configure-stamp build-stamp install-stamp
96
97 dh_clean
98
99install: install-stamp
100install-stamp: build-stamp
101 dh_testdir
102 dh_testroot
103 dh_clean -k
104 dh_installdirs
105
106 $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
107
108 mkdir -p $(MINGW_TMP)$(MINGW_BIN)
109 for name in $(MINGW_TMP)$(MINGW_TOP)/bin/*-config; \
110 do \
111 base=`basename $$name`; \
112 ln -v $$name $(MINGW_TMP)$(MINGW_BIN)/$(TARGET)-$$base; \
113 done
114
115 touch install-stamp
116
117# Build architecture-independent files here.
118binary-indep: build install
119# No binary-indep target.
120
121# Build architecture-dependent files here.
122binary-arch: build install
123 dh_testdir
124 dh_testroot
125 dh_installchangelogs NEWS
126 # dh_strip
127 dh_compress
128 dh_fixperms
129 dh_installdeb
130 dh_shlibdeps
131 dh_gencontrol
132 dh_md5sums
133 dh_builddeb
134
135binary: binary-indep binary-arch
136.PHONY: build clean binary-indep binary-arch binary install install-stamp