ncurses 6.2 - patch 20210522
[ncurses.git] / 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 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    = x86_64-w64-mingw32
22 MINGW_BIN = /usr/bin
23 MINGW_TOP = /usr/$(TARGET)
24 MINGW_TMP = $(CURDIR)/debian/mingw64-ncurses$(MY_ABI)
25
26 CFLAGS = $(CC_NORMAL)
27
28 verbose = # -v
29
30 CONFIG_OPTIONS = \
31         --disable-echo \
32         --disable-db-install \
33         --disable-getcap \
34         --disable-hard-tabs \
35         --disable-leaks \
36         --disable-macros \
37         --disable-overwrite \
38         --disable-termcap \
39         --enable-interop \
40         --enable-pc-files \
41         --enable-term-driver \
42         --enable-warnings \
43         --enable-widec \
44         --verbose \
45         --with-abi-version=$(MY_ABI) \
46         --with-cxx-shared \
47         --with-develop \
48         --with-fallbacks=unknown,rxvt \
49         --with-shared \
50         --with-trace \
51         --with-xterm-kbs=DEL \
52         --without-ada \
53         --without-debug \
54         --without-manpages \
55         --without-progs \
56         --without-tests
57
58 export CFLAGS BUILD_CC
59
60 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
61         CFLAGS += -O0
62 else
63         CFLAGS += -O2
64 endif
65 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
66         INSTALL_PROGRAM += -s
67 endif
68
69 configure: configure-stamp
70 configure-stamp:
71         dh_testdir
72
73         CC=$(TARGET)-gcc \
74         CFLAGS="$(CFLAGS)" \
75         ./configure \
76                 --host=$(TARGET) \
77                 --target=$(TARGET) \
78                 --prefix=$(MINGW_TOP) \
79                 --with-build-cc=$(BUILD_CC) \
80                 --with-pc-suffix=$(MY_ABI) \
81                 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \
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      $(verbose)
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          $(verbose)
130         dh_lintian           $(verbose)
131         dh_installdocs       $(verbose)
132         dh_installchangelogs $(verbose) NEWS
133         # dh_strip
134         dh_compress          $(verbose)
135         dh_fixperms          $(verbose)
136         dh_installdeb        $(verbose)
137         dh_shlibdeps         $(verbose)
138         dh_gencontrol        $(verbose)
139         dh_md5sums           $(verbose)
140         dh_builddeb          $(verbose)
141
142 binary: binary-indep binary-arch
143 .PHONY: build clean binary-indep binary-arch binary install install-stamp