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