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 PACKAGES.indep = # ncurses6-docs
11 PACKAGES.arch = ncurses6 ncursest6
13 # These are used for cross-compiling and for saving the configure script
14 # from having to guess our platform (since we know it already)
15 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
16 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
19 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
23 MYDATA=/usr/local/ncurses/share/terminfo
24 NORMAL_DIR=$(CURDIR)/debian/ncurses$(MY_ABI)
25 THREAD_DIR=$(CURDIR)/debian/ncursest$(MY_ABI)
27 CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(CC_NORMAL)
28 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
29 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
31 ifneq ($(MY_DIR),/usr)
32 RPATH_ENV = RPATH_LIST=../lib:$(MY_DIR)/lib
33 RPATH_OPT = --enable-rpath
36 RPATH_OPT = --disable-rpath --disable-rpath-hack
39 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
44 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
53 CPPFLAGS="$(CPPFLAGS)" \
54 LDFLAGS="$(LDFLAGS)" ../../configure $(RPATH_OPT) \
55 --host=$(DEB_HOST_GNU_TYPE) \
56 --build=$(DEB_BUILD_GNU_TYPE) \
58 --with-default-terminfo-dir=$(MYDATA) \
59 --with-terminfo-dirs=$(MYDATA):/usr/share/terminfo \
69 --enable-wgetch-events \
71 --program-suffix=$(MY_ABI) \
73 --with-abi-version=$(MY_ABI) \
75 --with-extra-suffix=$(MY_ABI) \
81 --with-terminfo-dirs=/lib/terminfo:/usr/share/terminfo \
82 --with-versioned-syms \
83 --with-xterm-kbs=DEL \
88 NCURSES6_DIR = $(CURDIR)/debian/ncurses6
89 NCURSEST6_DIR = $(CURDIR)/debian/ncursest6
91 .PHONY: all config build install binary clean config-indep config-arch \
92 build-indep build-arch install-indep install-arch binary-indep \
97 config: config-indep config-arch
98 build: build-indep build-arch
99 install: install-indep install-arch
100 binary: binary-indep binary-arch
107 config-indep: $(PACKAGES.indep:%=config-%-stamp)
108 config-arch: $(PACKAGES.arch:%=config-%-stamp)
110 build-indep: $(PACKAGES.indep:%=build-%-stamp)
111 build-arch: $(PACKAGES.arch:%=build-%-stamp)
113 install-indep: $(PACKAGES.indep:%=install-%-stamp)
114 install-arch: $(PACKAGES.arch:%=install-%-stamp)
116 config-ncurses6-stamp:
120 cd t/ncurses6; $(configure)
123 config-ncursest6-stamp:
127 cd t/ncursest6; $(configure) \
130 --program-suffix=t$(MY_ABI) \
134 build-ncurses6-stamp: config-ncurses6-stamp
137 $(MAKE) -C t/ncurses6
141 build-ncursest6-stamp: config-ncursest6-stamp
144 $(MAKE) -C t/ncursest6
148 install-ncurses6-stamp: build-ncurses6-stamp
151 dh_installdirs $(verbose)
152 dh_prep $(verbose) -pncurses6
154 $(MAKE) -C t/ncurses6 install.libs install.progs DESTDIR=$(NCURSES6_DIR)
155 $(MAKE) -C t/ncurses6/test ncurses LOCAL_LIBDIR=$(MY_DIR)/lib
157 mv t/ncurses6/test/ncurses $(NCURSES6_DIR)$(MY_DIR)/bin/ncurses$(MY_ABI)
161 install-ncursest6-stamp: build-ncursest6-stamp
164 dh_installdirs $(verbose)
165 dh_prep $(verbose) -pncursest6
167 $(MAKE) -C t/ncursest6 install.libs install.progs DESTDIR=$(NCURSEST6_DIR)
168 $(MAKE) -C t/ncursest6/test ncurses LOCAL_LIBDIR=$(MY_DIR)/lib
170 mv t/ncursest6/test/ncurses $(NCURSEST6_DIR)$(MY_DIR)/bin/ncursest$(MY_ABI)
174 # Build architecture-independent files here.
175 binary-indep: install-indep
176 ifneq ($(PACKAGES.indep),)
177 rm -f $(PACKAGES.indep:%=install-%-stamp)
180 dh_installdocs $(verbose) $(PACKAGES.indep:%=-p%)
181 dh_installman $(verbose) $(PACKAGES.indep:%=-p%)
182 dh_installexamples $(verbose) $(PACKAGES.indep:%=-p%)
183 dh_installchangelogs $(verbose) $(PACKAGES.indep:%=-p%) NEWS
184 dh_compress $(verbose) $(PACKAGES.indep:%=-p%)
185 dh_fixperms $(verbose) $(PACKAGES.indep:%=-p%)
186 dh_installdeb $(verbose) $(PACKAGES.indep:%=-p%)
187 dh_gencontrol $(verbose) $(PACKAGES.indep:%=-p%)
188 dh_md5sums $(verbose) $(PACKAGES.indep:%=-p%)
189 dh_builddeb $(verbose) $(PACKAGES.indep:%=-p%)
192 # Build architecture-dependent files here.
193 binary-arch: install-arch
194 ifneq ($(PACKAGES.arch),)
195 rm -f $(PACKAGES.arch:%=install-%-stamp)
198 dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) NEWS
199 dh_strip $(verbose) $(PACKAGES.arch:%=-p%)
200 dh_compress $(verbose) $(PACKAGES.arch:%=-p%)
201 dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%)
202 dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%)
203 dh_makeshlibs $(verbose) $(PACKAGES.arch:%=-p%)
204 dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%)
205 dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%)
206 dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%)
207 dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%)