]> ncurses.scripts.mit.edu Git - ncurses.git/blob - package/debian-mingw64/rules
fa9769edfb6d1269bdf849e99e726d2376bd0220
[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 MY_ABI=6
15
16 BUILD_CC = gcc
17
18 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
19 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
20
21 TARGET    = x86_64-w64-mingw32
22 MINGW_BIN = /usr/bin
23 MINGW_TOP = /usr/$(TARGET)
24 MINGW_TMP = $(CURDIR)/debian/mingw64-ncurses$(MY_ABI)
25
26 CFLAGS = $(CC_NORMAL)
27
28 verbose = # -v
29
30 CONFIG_OPTIONS = \
31         --disable-db-install \
32         --disable-echo \
33         --disable-getcap \
34         --disable-hard-tabs \
35         --disable-leaks \
36         --disable-macros \
37         --disable-overwrite \
38         --disable-termcap \
39         --enable-interop \
40         --enable-opaque-curses \
41         --enable-opaque-form \
42         --enable-opaque-menu \
43         --enable-opaque-panel \
44         --enable-pc-files \
45         --enable-term-driver \
46         --enable-warnings \
47         --enable-widec \
48         --verbose \
49         --with-abi-version=$(MY_ABI) \
50         --with-cxx-shared \
51         --with-develop \
52         --with-fallbacks=unknown,rxvt \
53         --with-shared \
54         --with-trace \
55         --with-xterm-kbs=DEL \
56         --without-ada \
57         --without-debug \
58         --without-manpages \
59         --without-progs \
60         --without-tests
61
62 export CFLAGS BUILD_CC
63
64 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
65         CFLAGS += -O0
66 else
67         CFLAGS += -O2
68 endif
69 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
70         INSTALL_PROGRAM += -s
71 endif
72
73 configure: configure-stamp
74 configure-stamp:
75         dh_testdir
76
77         CC=$(TARGET)-gcc \
78         CFLAGS="$(CFLAGS)" \
79         ./configure \
80                 --host=$(TARGET) \
81                 --target=$(TARGET) \
82                 --prefix=$(MINGW_TOP) \
83                 --with-build-cc=$(BUILD_CC) \
84                 --with-pc-suffix=$(MY_ABI) \
85                 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \
86                 $(CONFIG_OPTIONS)
87
88         touch configure-stamp
89
90 build: build-stamp
91 build-stamp: configure-stamp
92         dh_testdir
93
94         $(MAKE)
95
96         touch build-stamp
97
98 clean:
99         dh_testdir
100         dh_testroot
101
102         [ ! -f makefile ] || $(MAKE) distclean
103
104         rm -f configure-stamp build-stamp install-stamp
105
106         dh_clean
107
108 install: install-stamp
109 install-stamp: build-stamp
110         dh_testdir
111         dh_testroot
112         dh_clean -k
113         dh_installdirs      $(verbose)
114
115         $(MAKE) install.libs DESTDIR=$(MINGW_TMP)
116
117         mkdir -p $(MINGW_TMP)$(MINGW_BIN)
118         for name in $(MINGW_TMP)$(MINGW_TOP)/bin/*-config; \
119         do \
120                 base=`basename $$name`; \
121                 ln -v $$name $(MINGW_TMP)$(MINGW_BIN)/$(TARGET)-$$base; \
122         done
123
124         touch install-stamp
125
126 # Build architecture-independent files here.
127 binary-indep: build install
128 # No binary-indep target.
129
130 # Build architecture-dependent files here.
131 binary-arch: build install
132         dh_testdir
133         dh_testroot          $(verbose)
134         dh_lintian           $(verbose)
135         dh_installdocs       $(verbose)
136         dh_installchangelogs $(verbose) NEWS
137         # dh_strip
138         dh_compress          $(verbose)
139         dh_fixperms          $(verbose)
140         dh_installdeb        $(verbose)
141         dh_shlibdeps         $(verbose)
142         dh_gencontrol        $(verbose)
143         dh_md5sums           $(verbose)
144         dh_builddeb          $(verbose)
145
146 binary: binary-indep binary-arch
147 .PHONY: build clean binary-indep binary-arch binary install install-stamp