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)
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
28 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
35 CFLAGS="$(CFLAGS)" ../../configure \
36 --host=$(DEB_HOST_GNU_TYPE) \
37 --build=$(DEB_BUILD_GNU_TYPE) \
41 .PHONY: all config build install binary clean config-indep config-arch \
42 build-indep build-arch install-indep install-arch binary-indep \
47 config: config-indep config-arch
48 build: build-indep build-arch
49 install: install-indep install-arch
50 binary: binary-indep binary-arch
57 config-indep: $(PACKAGES.indep:%=config-%-stamp)
58 config-arch: $(PACKAGES.arch:%=config-%-stamp)
60 build-indep: $(PACKAGES.indep:%=build-%-stamp)
61 build-arch: $(PACKAGES.arch:%=build-%-stamp)
63 install-indep: $(PACKAGES.indep:%=install-%-stamp)
64 install-arch: $(PACKAGES.arch:%=install-%-stamp)
66 config-$(NCURSES_PKG)-stamp:
72 cd t/ncurses6; $(configure) \
73 --bindir=\$${prefix}/bin/$(NCURSES_PKG) \
74 --with-screen=ncursesw6
78 config-$(NCURSEST_PKG)-stamp:
84 cd t/ncursest6; $(configure) \
85 --bindir=\$${prefix}/bin/$(NCURSEST_PKG) \
86 --with-screen=ncursestw6
90 build-$(NCURSES_PKG)-stamp: config-$(NCURSES_PKG)-stamp
97 build-$(NCURSEST_PKG)-stamp: config-$(NCURSEST_PKG)-stamp
100 $(MAKE) -C t/ncursest6
104 install-$(NCURSES_PKG)-stamp: build-$(NCURSES_PKG)-stamp
107 dh_installdirs $(verbose)
108 dh_prep $(verbose) -p$(NCURSES_PKG)
110 $(MAKE) -C t/ncurses6 install DESTDIR=$(CURDIR)/debian/$(NCURSES_PKG)
114 install-$(NCURSEST_PKG)-stamp: build-$(NCURSEST_PKG)-stamp
117 dh_installdirs $(verbose)
118 dh_prep $(verbose) -p$(NCURSEST_PKG)
120 $(MAKE) -C t/ncursest6 install DESTDIR=$(CURDIR)/debian/$(NCURSEST_PKG)
124 # Build architecture-independent files here.
125 binary-indep: install-indep
126 ifneq ($(PACKAGES.indep),)
127 rm -f $(PACKAGES.indep:%=install-%-stamp)
130 dh_installdocs $(verbose) $(PACKAGES.indep:%=-p%)
131 dh_installman $(verbose) $(PACKAGES.indep:%=-p%)
132 dh_installexamples $(verbose) $(PACKAGES.indep:%=-p%)
133 dh_installchangelogs $(verbose) $(PACKAGES.indep:%=-p%) NEWS
134 dh_compress $(verbose) $(PACKAGES.indep:%=-p%)
135 dh_fixperms $(verbose) $(PACKAGES.indep:%=-p%)
136 dh_installdeb $(verbose) $(PACKAGES.indep:%=-p%)
137 dh_gencontrol $(verbose) $(PACKAGES.indep:%=-p%)
138 dh_md5sums $(verbose) $(PACKAGES.indep:%=-p%)
139 dh_builddeb $(verbose) $(PACKAGES.indep:%=-p%)
142 # Build architecture-dependent files here.
143 binary-arch: install-arch
144 ifneq ($(PACKAGES.arch),)
145 rm -f $(PACKAGES.arch:%=install-%-stamp)
148 dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) NEWS
149 dh_strip $(verbose) $(PACKAGES.arch:%=-p%)
150 dh_compress $(verbose) $(PACKAGES.arch:%=-p%)
151 dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%)
152 dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%)
153 dh_makeshlibs $(verbose) $(PACKAGES.arch:%=-p%)
154 dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%)
155 dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%)
156 dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%)
157 dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%)