blob: bed7a82a76cc7c8f090efe83436be64857d04476 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#!/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# packages
10NCURSES_PKG = ncurses-examples
11NCURSEST_PKG = ncursest-examples
12
13PACKAGES.indep = # ncurses-examples-docs
14PACKAGES.arch = $(NCURSES_PKG) $(NCURSEST_PKG)
15
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)
18DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
20
21CFLAGS =
22
23ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24 CFLAGS += -O0
25else
26 CFLAGS += -O2
27endif
28ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
29 INSTALL_PROGRAM += -s
30endif
31
32verbose = # -v
33
34configure = \
35 CFLAGS="$(CFLAGS)" ../../configure \
36 --host=$(DEB_HOST_GNU_TYPE) \
37 --build=$(DEB_BUILD_GNU_TYPE) \
38 --prefix=/usr \
39 --disable-rpath-hack
40
41.PHONY: all config build install binary clean config-indep config-arch \
42 build-indep build-arch install-indep install-arch binary-indep \
43 binary-arch
44
45all: build
46
47config: config-indep config-arch
48build: build-indep build-arch
49install: install-indep install-arch
50binary: binary-indep binary-arch
51clean:
52 dh_testdir
53 dh_testroot
54 dh_clean $(verbose)
55 rm -rf t
56
57config-indep: $(PACKAGES.indep:%=config-%-stamp)
58config-arch: $(PACKAGES.arch:%=config-%-stamp)
59
60build-indep: $(PACKAGES.indep:%=build-%-stamp)
61build-arch: $(PACKAGES.arch:%=build-%-stamp)
62
63install-indep: $(PACKAGES.indep:%=install-%-stamp)
64install-arch: $(PACKAGES.arch:%=install-%-stamp)
65
66config-$(NCURSES_PKG)-stamp:
67 dh_testdir
68
69 rm -rf t/ncurses6
70 mkdir -p t/ncurses6
71
72 cd t/ncurses6; $(configure) \
73 --bindir=\$${prefix}/bin/$(NCURSES_PKG) \
74 --with-screen=ncursesw6
75
76 touch $@
77
78config-$(NCURSEST_PKG)-stamp:
79 dh_testdir
80
81 rm -rf t/ncursest6
82 mkdir -p t/ncursest6
83
84 cd t/ncursest6; $(configure) \
85 --bindir=\$${prefix}/bin/$(NCURSEST_PKG) \
86 --with-screen=ncursestw6
87
88 touch $@
89
90build-$(NCURSES_PKG)-stamp: config-$(NCURSES_PKG)-stamp
91 dh_testdir
92
93 $(MAKE) -C t/ncurses6
94
95 touch $@
96
97build-$(NCURSEST_PKG)-stamp: config-$(NCURSEST_PKG)-stamp
98 dh_testdir
99
100 $(MAKE) -C t/ncursest6
101
102 touch $@
103
104install-$(NCURSES_PKG)-stamp: build-$(NCURSES_PKG)-stamp
105 dh_testdir
106 dh_testroot
107 dh_installdirs $(verbose)
108 dh_prep $(verbose) -p$(NCURSES_PKG)
109
110 $(MAKE) -C t/ncurses6 install DESTDIR=$(CURDIR)/debian/$(NCURSES_PKG)
111
112 touch $@
113
114install-$(NCURSEST_PKG)-stamp: build-$(NCURSEST_PKG)-stamp
115 dh_testdir
116 dh_testroot
117 dh_installdirs $(verbose)
118 dh_prep $(verbose) -p$(NCURSEST_PKG)
119
120 $(MAKE) -C t/ncursest6 install DESTDIR=$(CURDIR)/debian/$(NCURSEST_PKG)
121
122 touch $@
123
124# Build architecture-independent files here.
125binary-indep: install-indep
126ifneq ($(PACKAGES.indep),)
127 rm -f $(PACKAGES.indep:%=install-%-stamp)
128 dh_testdir
129 dh_testroot
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%)
140endif
141
142# Build architecture-dependent files here.
143binary-arch: install-arch
144ifneq ($(PACKAGES.arch),)
145 rm -f $(PACKAGES.arch:%=install-%-stamp)
146 dh_testdir
147 dh_testroot
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%)
158endif