ncurses 6.1 - patch 20190803
[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 MY_ABI=6
15
16 BUILD_CC = gcc
17
18 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
19 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
20
21 TARGET    = i686-w64-mingw32
22 MINGW_BIN = /usr/bin
23 MINGW_TOP = /usr/$(TARGET)
24 MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses$(MY_ABI)
25
26 CFLAGS = $(CC_NORMAL)
27
28 verbose = # -v
29
30 CONFIG_OPTIONS = \
31         --disable-db-install \
32         --disable-echo \
33         --disable-getcap \
34         --disable-hard-tabs \
35         --disable-leaks \
36         --disable-macros \
37         --disable-overwrite \
38         --disable-termcap \
39         --enable-interop \
40         --enable-opaque-curses \
41         --enable-opaque-form \
42         --enable-opaque-menu \
43         --enable-opaque-panel \
44         --enable-pc-files \
45         --enable-term-driver \
46         --enable-warnings \
47         --enable-widec \
48         --verbose \
49         --with-abi-version=$(MY_ABI) \
50         --with-cxx-shared \
51         --with-develop \
52         --with-fallbacks=unknown,rxvt \
53         --with-tic-path=/usr/bin/tic$(MY_ABI) \
54         --with-infocmp-path=/usr/bin/infocmp$(MY_ABI) \
55         --with-shared \
56         --with-trace \
57         --with-xterm-kbs=DEL \
58         --without-ada \
59         --without-debug \
60         --without-manpages \
61         --without-progs \
62         --without-tests
63
64 export CFLAGS BUILD_CC
65
66 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
67         CFLAGS += -O0
68 else
69         CFLAGS += -O2
70 endif
71 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
72         INSTALL_PROGRAM += -s
73 endif
74
75 configure: configure-stamp
76 configure-stamp:
77         dh_testdir
78
79         CC=$(TARGET)-gcc \
80         CFLAGS="$(CFLAGS)" \
81         ./configure \
82                 --host=$(TARGET) \
83                 --target=$(TARGET) \
84                 --prefix=$(MINGW_TOP) \
85                 --with-build-cc=$(BUILD_CC) \
86                 --with-pc-suffix=$(MY_ABI) \
87                 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \
88                 $(CONFIG_OPTIONS)
89
90         touch configure-stamp
91
92 build: build-stamp
93 build-stamp: configure-stamp
94         dh_testdir
95
96         $(MAKE)
97
98         touch build-stamp
99
100 clean:
101         dh_testdir
102         dh_testroot
103
104         [ ! -f makefile ] || $(MAKE) distclean
105
106         rm -f configure-stamp build-stamp install-stamp
107
108         dh_clean
109
110 install: install-stamp
111 install-stamp: build-stamp
112         dh_testdir
113         dh_testroot
114         dh_clean -k
115         dh_installdirs      $(verbose)
116
117         $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
118
119         mkdir -p $(MINGW_TMP)$(MINGW_BIN)
120         for name in $(MINGW_TMP)$(MINGW_TOP)/bin/*-config; \
121         do \
122                 base=`basename $$name`; \
123                 ln -v $$name $(MINGW_TMP)$(MINGW_BIN)/$(TARGET)-$$base; \
124         done
125
126         touch install-stamp
127
128 # Build architecture-independent files here.
129 binary-indep: build install
130 # No binary-indep target.
131
132 # Build architecture-dependent files here.
133 binary-arch: build install
134         dh_testdir
135         dh_testroot          $(verbose)
136         dh_lintian           $(verbose)
137         dh_installdocs       $(verbose)
138         dh_installchangelogs $(verbose) NEWS
139         # dh_strip
140         dh_compress          $(verbose)
141         dh_fixperms          $(verbose)
142         dh_installdeb        $(verbose)
143         dh_shlibdeps         $(verbose)
144         dh_gencontrol        $(verbose)
145         dh_md5sums           $(verbose)
146         dh_builddeb          $(verbose)
147
148 binary: binary-indep binary-arch
149 .PHONY: build clean binary-indep binary-arch binary install install-stamp