ncurses 5.9 - patch 20131012
[ncurses.git] / package / debian-mingw64 / rules
1 #!/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)
11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14 BUILD_CC = gcc
15
16 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
17 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
18
19 TARGET    = x86_64-w64-mingw32
20 MINGW_TOP = /usr/$(TARGET)
21 MINGW_TMP = $(CURDIR)/debian/mingw64-ncurses6
22
23 CFLAGS = $(CC_NORMAL)
24
25 CONFIG_OPTIONS = \
26         --disable-echo \
27         --disable-db-install \
28         --disable-getcap \
29         --disable-hard-tabs \
30         --disable-leaks \
31         --disable-macros \
32         --disable-overwrite \
33         --disable-termcap \
34         --enable-const \
35         --enable-ext-colors \
36         --enable-ext-mouse \
37         --enable-interop \
38         --enable-sp-funcs \
39         --enable-term-driver \
40         --enable-warnings \
41         --enable-widec \
42         --verbose \
43         --with-cxx-shared \
44         --with-develop \
45         --with-fallbacks=unknown,rxvt \
46         --with-shared \
47         --with-tparm-arg=intptr_t \
48         --with-trace \
49         --with-xterm-kbs=DEL \
50         --without-ada \
51         --without-debug \
52         --without-manpages \
53         --without-progs \
54         --without-tests
55
56 export CFLAGS BUILD_CC
57
58 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
59         CFLAGS += -O0
60 else
61         CFLAGS += -O2
62 endif
63 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
64         INSTALL_PROGRAM += -s
65 endif
66
67 configure: configure-stamp
68 configure-stamp:
69         dh_testdir
70
71         CC=$(TARGET)-gcc \
72         CFLAGS="$(CFLAGS)" \
73         ./configure \
74                 --host=$(TARGET) \
75                 --target=$(TARGET) \
76                 --prefix=$(MINGW_TOP) \
77                 --with-build-cc=$(BUILD_CC) \
78                 $(CONFIG_OPTIONS)
79
80         touch configure-stamp
81
82 build: build-stamp
83 build-stamp: configure-stamp
84         dh_testdir
85
86         $(MAKE)
87
88         touch build-stamp
89
90 clean:
91         dh_testdir
92         dh_testroot
93
94         [ ! -f makefile ] || $(MAKE) distclean
95
96         rm -f configure-stamp build-stamp install-stamp
97
98         dh_clean
99
100 install: install-stamp
101 install-stamp: build-stamp
102         dh_testdir
103         dh_testroot
104         dh_clean -k
105         dh_installdirs
106
107         $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
108
109         touch install-stamp
110
111 # Build architecture-independent files here.
112 binary-indep: build install
113 # No binary-indep target.
114
115 # Build architecture-dependent files here.
116 binary-arch: build install
117         dh_testdir
118         dh_testroot
119         dh_installchangelogs NEWS
120         # dh_strip
121         dh_compress
122         dh_fixperms
123         dh_installdeb
124         dh_shlibdeps
125         dh_gencontrol
126         dh_md5sums
127         dh_builddeb
128
129 binary: binary-indep binary-arch
130 .PHONY: build clean binary-indep binary-arch binary install install-stamp