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-versioned-syms \
82 --with-xterm-kbs=DEL \
87 NCURSES6_DIR = $(CURDIR)/debian/ncurses6
88 NCURSEST6_DIR = $(CURDIR)/debian/ncursest6
90 .PHONY: all config build install binary clean config-indep config-arch \
91 build-indep build-arch install-indep install-arch binary-indep \
96 config: config-indep config-arch
97 build: build-indep build-arch
98 install: install-indep install-arch
99 binary: binary-indep binary-arch
106 config-indep: $(PACKAGES.indep:%=config-%-stamp)
107 config-arch: $(PACKAGES.arch:%=config-%-stamp)
109 build-indep: $(PACKAGES.indep:%=build-%-stamp)
110 build-arch: $(PACKAGES.arch:%=build-%-stamp)
112 install-indep: $(PACKAGES.indep:%=install-%-stamp)
113 install-arch: $(PACKAGES.arch:%=install-%-stamp)
115 config-ncurses6-stamp:
119 cd t/ncurses6; $(configure)
122 config-ncursest6-stamp:
126 cd t/ncursest6; $(configure) \
129 --program-suffix=t$(MY_ABI) \
133 build-ncurses6-stamp: config-ncurses6-stamp
136 $(MAKE) -C t/ncurses6
140 build-ncursest6-stamp: config-ncursest6-stamp
143 $(MAKE) -C t/ncursest6
147 install-ncurses6-stamp: build-ncurses6-stamp
150 dh_installdirs $(verbose)
151 dh_prep $(verbose) -pncurses6
153 $(MAKE) -C t/ncurses6 install.libs install.progs DESTDIR=$(NCURSES6_DIR)
154 $(MAKE) -C t/ncurses6/test ncurses LOCAL_LIBDIR=$(MY_DIR)/lib
156 mv t/ncurses6/test/ncurses $(NCURSES6_DIR)$(MY_DIR)/bin/ncurses$(MY_ABI)
160 install-ncursest6-stamp: build-ncursest6-stamp
163 dh_installdirs $(verbose)
164 dh_prep $(verbose) -pncursest6
166 $(MAKE) -C t/ncursest6 install.libs install.progs DESTDIR=$(NCURSEST6_DIR)
167 $(MAKE) -C t/ncursest6/test ncurses LOCAL_LIBDIR=$(MY_DIR)/lib
169 mv t/ncursest6/test/ncurses $(NCURSEST6_DIR)$(MY_DIR)/bin/ncursest$(MY_ABI)
173 # Build architecture-independent files here.
174 binary-indep: install-indep
175 ifneq ($(PACKAGES.indep),)
176 rm -f $(PACKAGES.indep:%=install-%-stamp)
179 dh_installdocs $(verbose) $(PACKAGES.indep:%=-p%)
180 dh_installman $(verbose) $(PACKAGES.indep:%=-p%)
181 dh_installexamples $(verbose) $(PACKAGES.indep:%=-p%)
182 dh_installchangelogs $(verbose) $(PACKAGES.indep:%=-p%) NEWS
183 dh_compress $(verbose) $(PACKAGES.indep:%=-p%)
184 dh_fixperms $(verbose) $(PACKAGES.indep:%=-p%)
185 dh_installdeb $(verbose) $(PACKAGES.indep:%=-p%)
186 dh_gencontrol $(verbose) $(PACKAGES.indep:%=-p%)
187 dh_md5sums $(verbose) $(PACKAGES.indep:%=-p%)
188 dh_builddeb $(verbose) $(PACKAGES.indep:%=-p%)
191 # Build architecture-dependent files here.
192 binary-arch: install-arch
193 ifneq ($(PACKAGES.arch),)
194 rm -f $(PACKAGES.arch:%=install-%-stamp)
197 dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) NEWS
198 dh_strip $(verbose) $(PACKAGES.arch:%=-p%)
199 dh_compress $(verbose) $(PACKAGES.arch:%=-p%)
200 dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%)
201 dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%)
202 dh_makeshlibs $(verbose) $(PACKAGES.arch:%=-p%)
203 dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%)
204 dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%)
205 dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%)
206 dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%)