]> ncurses.scripts.mit.edu Git - ncurses.git/blob - package/debian-mingw64/rules
da793d921b08e7334cd290189a20a5ec0bd9df6e
[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_TOP = /usr/$(TARGET)
21 MINGW_TMP = $(CURDIR)/debian/mingw64-ncurses6
22
23 CFLAGS = $(CC_NORMAL)
24
25 CONFIG_OPTIONS = \
26         --disable-echo \
27         --disable-db-install \
28         --disable-getcap \
29         --disable-hard-tabs \
30         --disable-leaks \
31         --disable-macros \
32         --disable-overwrite \
33         --disable-termcap \
34         --enable-const \
35         --enable-ext-colors \
36         --enable-ext-mouse \
37         --enable-interop \
38         --enable-sp-funcs \
39         --enable-term-driver \
40         --enable-warnings \
41         --enable-widec \
42         --verbose \
43         --with-chtype=uint32_t \
44         --with-mmask_t=uint32_t \
45         --with-cxx-shared \
46         --with-develop \
47         --with-fallbacks=unknown,rxvt \
48         --with-shared \
49         --with-tparm-arg=intptr_t \
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                 $(CONFIG_OPTIONS)
81
82         touch configure-stamp
83
84 build: build-stamp
85 build-stamp: configure-stamp
86         dh_testdir
87
88         $(MAKE)
89
90         touch build-stamp
91
92 clean:
93         dh_testdir
94         dh_testroot
95
96         [ ! -f makefile ] || $(MAKE) distclean
97
98         rm -f configure-stamp build-stamp install-stamp
99
100         dh_clean
101
102 install: install-stamp
103 install-stamp: build-stamp
104         dh_testdir
105         dh_testroot
106         dh_clean -k
107         dh_installdirs
108
109         $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
110
111         touch install-stamp
112
113 # Build architecture-independent files here.
114 binary-indep: build install
115 # No binary-indep target.
116
117 # Build architecture-dependent files here.
118 binary-arch: build install
119         dh_testdir
120         dh_testroot
121         dh_installchangelogs NEWS
122         # dh_strip
123         dh_compress
124         dh_fixperms
125         dh_installdeb
126         dh_shlibdeps
127         dh_gencontrol
128         dh_md5sums
129         dh_builddeb
130
131 binary: binary-indep binary-arch
132 .PHONY: build clean binary-indep binary-arch binary install install-stamp