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