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.
6 # Uncomment this to turn on verbose mode.
10 NCURSES_PKG = ncurses-examples
11 NCURSEST_PKG = ncursest-examples
13 PACKAGES.indep = # ncurses-examples-docs
14 PACKAGES.arch = $(NCURSES_PKG) $(NCURSEST_PKG)
16 # These are used for cross-compiling and for saving the configure script
17 # from having to guess our platform (since we know it already)
18 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
21 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
22 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
23 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
25 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
30 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
38 CPPFLAGS="$(CPPFLAGS)" \
39 LDFLAGS="$(LDFLAGS)" ../../configure \
40 --host=$(DEB_HOST_GNU_TYPE) \
41 --build=$(DEB_BUILD_GNU_TYPE) \
45 .PHONY: all config build install binary clean config-indep config-arch \
46 build-indep build-arch install-indep install-arch binary-indep \
51 config: config-indep config-arch
52 build: build-indep build-arch
53 install: install-indep install-arch
54 binary: binary-indep binary-arch
61 config-indep: $(PACKAGES.indep:%=config-%-stamp)
62 config-arch: $(PACKAGES.arch:%=config-%-stamp)
64 build-indep: $(PACKAGES.indep:%=build-%-stamp)
65 build-arch: $(PACKAGES.arch:%=build-%-stamp)
67 install-indep: $(PACKAGES.indep:%=install-%-stamp)
68 install-arch: $(PACKAGES.arch:%=install-%-stamp)
70 config-$(NCURSES_PKG)-stamp:
76 cd t/ncurses6; $(configure) \
77 --datadir=\$${datarootdir}/$(NCURSES_PKG) \
78 --with-screen=ncurses6
82 config-$(NCURSEST_PKG)-stamp:
88 cd t/ncursest6; $(configure) \
89 --datadir=\$${datarootdir}/$(NCURSEST_PKG) \
90 --with-screen=ncursest6
94 build-$(NCURSES_PKG)-stamp: config-$(NCURSES_PKG)-stamp
101 build-$(NCURSEST_PKG)-stamp: config-$(NCURSEST_PKG)-stamp
104 $(MAKE) -C t/ncursest6
108 install-$(NCURSES_PKG)-stamp: build-$(NCURSES_PKG)-stamp
111 dh_installdirs $(verbose)
112 dh_prep $(verbose) -p$(NCURSES_PKG)
114 $(MAKE) -C t/ncurses6 install \
115 PACKAGE=$(NCURSES_PKG) \
116 DESTDIR=$(CURDIR)/debian/$(NCURSES_PKG)
120 install-$(NCURSEST_PKG)-stamp: build-$(NCURSEST_PKG)-stamp
123 dh_installdirs $(verbose)
124 dh_prep $(verbose) -p$(NCURSEST_PKG)
126 $(MAKE) -C t/ncursest6 install \
127 PACKAGE=$(NCURSEST_PKG) \
128 DESTDIR=$(CURDIR)/debian/$(NCURSEST_PKG)
132 # Build architecture-independent files here.
133 binary-indep: install-indep
134 ifneq ($(PACKAGES.indep),)
135 rm -f $(PACKAGES.indep:%=install-%-stamp)
138 dh_installdocs $(verbose) $(PACKAGES.indep:%=-p%)
139 dh_installman $(verbose) $(PACKAGES.indep:%=-p%)
140 dh_installexamples $(verbose) $(PACKAGES.indep:%=-p%)
141 dh_installchangelogs $(verbose) $(PACKAGES.indep:%=-p%) NEWS
142 dh_compress $(verbose) $(PACKAGES.indep:%=-p%)
143 dh_fixperms $(verbose) $(PACKAGES.indep:%=-p%)
144 dh_installdeb $(verbose) $(PACKAGES.indep:%=-p%)
145 dh_gencontrol $(verbose) $(PACKAGES.indep:%=-p%)
146 dh_md5sums $(verbose) $(PACKAGES.indep:%=-p%)
147 dh_builddeb $(verbose) $(PACKAGES.indep:%=-p%)
150 # Build architecture-dependent files here.
151 binary-arch: install-arch
152 ifneq ($(PACKAGES.arch),)
153 rm -f $(PACKAGES.arch:%=install-%-stamp)
156 dh_installdocs $(verbose) $(PACKAGES.arch:%=-p%)
157 dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) NEWS
158 dh_strip $(verbose) $(PACKAGES.arch:%=-p%)
159 dh_compress $(verbose) $(PACKAGES.arch:%=-p%)
160 dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%)
161 dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%)
162 dh_makeshlibs $(verbose) $(PACKAGES.arch:%=-p%)
163 dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%)
164 dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%)
165 dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%)
166 dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%)