]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/package/debian/rules
ncurses 5.8 - patch 20110326
[ncurses.git] / test / package / debian / 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 CFLAGS =
15
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17         CFLAGS += -O0
18 else
19         CFLAGS += -O2
20 endif
21 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
22         INSTALL_PROGRAM += -s
23 endif
24
25
26 configure: configure-stamp
27 configure-stamp:
28         dh_testdir
29
30         CFLAGS="$(CFLAGS)" ./configure \
31                 --host=$(DEB_HOST_GNU_TYPE) \
32                 --build=$(DEB_BUILD_GNU_TYPE) \
33                 --bindir=\$${prefix}/bin/ncurses-examples \
34                 --prefix=/usr \
35                 --with-ncursesw \
36                 --disable-rpath-hack
37
38         touch configure-stamp
39
40 build: build-stamp
41 build-stamp: configure-stamp
42         dh_testdir
43
44         $(MAKE)
45
46         touch build-stamp
47
48 clean:
49         dh_testdir
50         dh_testroot
51
52         [ ! -f makefile ] || $(MAKE) distclean
53
54         rm -f configure-stamp build-stamp install-stamp
55
56         dh_clean
57
58 install: install-stamp
59 install-stamp: build-stamp
60         dh_testdir
61         dh_testroot
62         dh_clean -k
63         dh_installdirs
64
65         $(MAKE) install DESTDIR=$(CURDIR)/debian/ncurses-examples
66
67         touch install-stamp
68
69 # Build architecture-independent files here.
70 binary-indep: build install
71 # No binary-indep target.
72
73 # Build architecture-dependent files here.
74 binary-arch: build install
75         dh_testdir
76         dh_testroot
77         dh_installdocs
78         dh_installexamples
79         dh_installchangelogs NEWS
80         dh_strip
81         dh_compress
82         dh_fixperms
83         dh_installdeb
84         dh_shlibdeps
85         dh_gencontrol
86         dh_md5sums
87         dh_builddeb
88
89 binary: binary-indep binary-arch
90 .PHONY: build clean binary-indep binary-arch binary install install-stamp