]> ncurses.scripts.mit.edu Git - ncurses.git/blob - package/debian-mingw/rules
ncurses 6.0 - patch 20170225
[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-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
54 export CFLAGS BUILD_CC
55
56 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
57         CFLAGS += -O0
58 else
59         CFLAGS += -O2
60 endif
61 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
62         INSTALL_PROGRAM += -s
63 endif
64
65 configure: configure-stamp
66 configure-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
81 build: build-stamp
82 build-stamp: configure-stamp
83         dh_testdir
84
85         $(MAKE)
86
87         touch build-stamp
88
89 clean:
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
99 install: install-stamp
100 install-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.
118 binary-indep: build install
119 # No binary-indep target.
120
121 # Build architecture-dependent files here.
122 binary-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
135 binary: binary-indep binary-arch
136 .PHONY: build clean binary-indep binary-arch binary install install-stamp