]> ncurses.scripts.mit.edu Git - ncurses.git/blob - package/debian-mingw/rules
ncurses 6.0 - patch 20170909
[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 verbose = # -v
27
28 CONFIG_OPTIONS = \
29         --disable-echo \
30         --disable-db-install \
31         --disable-getcap \
32         --disable-hard-tabs \
33         --disable-leaks \
34         --disable-macros \
35         --disable-overwrite \
36         --disable-termcap \
37         --enable-interop \
38         --enable-pc-files \
39         --enable-term-driver \
40         --enable-warnings \
41         --enable-widec \
42         --verbose \
43         --with-abi-version=6 \
44         --with-cxx-shared \
45         --with-develop \
46         --with-fallbacks=unknown,rxvt \
47         --with-shared \
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                 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \
79                 $(CONFIG_OPTIONS)
80
81         touch configure-stamp
82
83 build: build-stamp
84 build-stamp: configure-stamp
85         dh_testdir
86
87         $(MAKE)
88
89         touch build-stamp
90
91 clean:
92         dh_testdir
93         dh_testroot
94
95         [ ! -f makefile ] || $(MAKE) distclean
96
97         rm -f configure-stamp build-stamp install-stamp
98
99         dh_clean
100
101 install: install-stamp
102 install-stamp: build-stamp
103         dh_testdir
104         dh_testroot
105         dh_clean -k
106         dh_installdirs      $(verbose)
107
108         $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
109
110         mkdir -p $(MINGW_TMP)$(MINGW_BIN)
111         for name in $(MINGW_TMP)$(MINGW_TOP)/bin/*-config; \
112         do \
113                 base=`basename $$name`; \
114                 ln -v $$name $(MINGW_TMP)$(MINGW_BIN)/$(TARGET)-$$base; \
115         done
116
117         touch install-stamp
118
119 # Build architecture-independent files here.
120 binary-indep: build install
121 # No binary-indep target.
122
123 # Build architecture-dependent files here.
124 binary-arch: build install
125         dh_testdir
126         dh_testroot          $(verbose)
127         dh_lintian           $(verbose)
128         dh_installdocs       $(verbose)
129         dh_installchangelogs $(verbose) NEWS
130         # dh_strip
131         dh_compress          $(verbose)
132         dh_fixperms          $(verbose)
133         dh_installdeb        $(verbose)
134         dh_shlibdeps         $(verbose)
135         dh_gencontrol        $(verbose)
136         dh_md5sums           $(verbose)
137         dh_builddeb          $(verbose)
138
139 binary: binary-indep binary-arch
140 .PHONY: build clean binary-indep binary-arch binary install install-stamp