ncurses 5.9 - patch 20150328
[ncurses.git] / package / debian-mingw / 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    = i686-w64-mingw32
20 MINGW_BIN = /usr/bin
21 MINGW_TOP = /usr/$(TARGET)
22 MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses6
23
24 CFLAGS = $(CC_NORMAL)
25
26 CONFIG_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-const \
36         --enable-ext-colors \
37         --enable-ext-mouse \
38         --enable-ext-putwin \
39         --enable-interop \
40         --enable-sp-funcs \
41         --enable-term-driver \
42         --enable-warnings \
43         --enable-widec \
44         --verbose \
45         --with-chtype=uint32_t \
46         --with-mmask_t=uint32_t \
47         --with-cxx-shared \
48         --with-develop \
49         --with-fallbacks=unknown,rxvt \
50         --with-shared \
51         --with-tparm-arg=intptr_t \
52         --with-trace \
53         --with-xterm-kbs=DEL \
54         --without-ada \
55         --without-debug \
56         --without-manpages \
57         --without-progs \
58         --without-tests
59
60 export CFLAGS BUILD_CC
61
62 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
63         CFLAGS += -O0
64 else
65         CFLAGS += -O2
66 endif
67 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
68         INSTALL_PROGRAM += -s
69 endif
70
71 configure: configure-stamp
72 configure-stamp:
73         dh_testdir
74
75         CC=$(TARGET)-gcc \
76         CFLAGS="$(CFLAGS)" \
77         ./configure \
78                 --host=$(TARGET) \
79                 --target=$(TARGET) \
80                 --prefix=$(MINGW_TOP) \
81                 --with-build-cc=$(BUILD_CC) \
82                 $(CONFIG_OPTIONS)
83
84         touch configure-stamp
85
86 build: build-stamp
87 build-stamp: configure-stamp
88         dh_testdir
89
90         $(MAKE)
91
92         touch build-stamp
93
94 clean:
95         dh_testdir
96         dh_testroot
97
98         [ ! -f makefile ] || $(MAKE) distclean
99
100         rm -f configure-stamp build-stamp install-stamp
101
102         dh_clean
103
104 install: install-stamp
105 install-stamp: build-stamp
106         dh_testdir
107         dh_testroot
108         dh_clean -k
109         dh_installdirs
110
111         $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
112
113         mkdir -p $(MINGW_TMP)$(MINGW_BIN)
114         for name in $(MINGW_TMP)$(MINGW_TOP)/bin/*-config; \
115         do \
116                 base=`basename $$name`; \
117                 ln -v $$name $(MINGW_TMP)$(MINGW_BIN)/$(TARGET)-$$base; \
118         done
119
120         touch install-stamp
121
122 # Build architecture-independent files here.
123 binary-indep: build install
124 # No binary-indep target.
125
126 # Build architecture-dependent files here.
127 binary-arch: build install
128         dh_testdir
129         dh_testroot
130         dh_installchangelogs NEWS
131         # dh_strip
132         dh_compress
133         dh_fixperms
134         dh_installdeb
135         dh_shlibdeps
136         dh_gencontrol
137         dh_md5sums
138         dh_builddeb
139
140 binary: binary-indep binary-arch
141 .PHONY: build clean binary-indep binary-arch binary install install-stamp