]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/package/debian-mingw/rules
ncurses 5.9 - patch 20150516
[ncurses.git] / test / 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 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
15 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
16
17 TARGET    = i686-w64-mingw32
18 MINGW_BIN = /usr/bin
19 MINGW_TOP = /usr/$(TARGET)
20 MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses-examples
21
22 CFLAGS = $(CC_NORMAL)
23
24 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
25         CFLAGS += -O0
26 else
27         CFLAGS += -O2
28 endif
29 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
30         INSTALL_PROGRAM += -s
31 endif
32
33
34 configure: configure-stamp
35 configure-stamp:
36         dh_testdir
37
38         CFLAGS="$(CFLAGS)" ./configure \
39                 --host=$(TARGET) \
40                 --target=$(TARGET) \
41                 --prefix=$(MINGW_TOP) \
42                 --with-screen=ncursesw6 \
43                 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig
44
45         touch configure-stamp
46
47 build: build-stamp
48 build-stamp: configure-stamp
49         dh_testdir
50
51         $(MAKE)
52
53         touch build-stamp
54
55 clean:
56         dh_testdir
57         dh_testroot
58
59         [ ! -f makefile ] || $(MAKE) distclean
60
61         rm -f configure-stamp build-stamp install-stamp
62
63         dh_clean
64
65 install: install-stamp
66 install-stamp: build-stamp
67         dh_testdir
68         dh_testroot
69         dh_clean -k
70         dh_installdirs
71
72         $(MAKE) install DESTDIR=$(MINGW_TMP)
73
74         touch install-stamp
75
76 # Build architecture-independent files here.
77 binary-indep: build install
78 # No binary-indep target.
79
80 # Build architecture-dependent files here.
81 binary-arch: build install
82         dh_testdir
83         dh_testroot
84         dh_installdocs
85         dh_installexamples
86         dh_installchangelogs NEWS
87         dh_strip
88         dh_compress
89         dh_fixperms
90         dh_installdeb
91         dh_shlibdeps
92         dh_gencontrol
93         dh_md5sums
94         dh_builddeb
95
96 binary: binary-indep binary-arch
97 .PHONY: build clean binary-indep binary-arch binary install install-stamp