ncurses 5.9 - patch 20150516
[ncurses.git] / package / debian / rules
1 #!/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 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14 CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
15 CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
16
17 MY_ABI=6
18 MY_DIR=/usr
19 MYDATA=/usr/local/ncurses/share/terminfo
20 BUILD_DIR=$(CURDIR)/debian/ncurses$(MY_ABI)
21
22 CFLAGS   = $(shell dpkg-buildflags --get CFLAGS) $(CC_NORMAL)
23 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
24 LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)
25
26 ifneq ($(MY_DIR),/usr)
27         RPATH_ENV = RPATH_LIST=../lib:$(MY_DIR)/lib
28         RPATH_OPT = --enable-rpath
29 else
30         RPATH_ENV =
31         RPATH_OPT = --disable-rpath --disable-rpath-hack
32 endif
33
34 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
35         CFLAGS += -O0
36 else
37         CFLAGS += -O2
38 endif
39 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
40         INSTALL_PROGRAM += -s
41 endif
42
43
44 configure: configure-stamp
45 configure-stamp:
46         dh_testdir
47
48         $(RPATH_ENV) \
49         CFLAGS="$(CFLAGS)" \
50         CPPFLAGS="$(CPPFLAGS)" \
51         LDFLAGS="$(LDFLAGS)" ./configure $(RPATH_OPT) \
52                 --host=$(DEB_HOST_GNU_TYPE) \
53                 --build=$(DEB_BUILD_GNU_TYPE) \
54                 --prefix=$(MY_DIR) \
55                 --with-default-terminfo-dir=$(MYDATA) \
56                 --with-terminfo-dirs=$(MYDATA):/usr/share/terminfo \
57                 --disable-echo \
58                 --disable-getcap \
59                 --disable-leaks \
60                 --disable-macros  \
61                 --disable-overwrite  \
62                 --disable-termcap \
63                 --enable-const \
64                 --enable-ext-colors \
65                 --enable-ext-mouse \
66                 --enable-ext-putwin \
67                 --enable-hard-tabs \
68                 --enable-interop \
69                 --enable-pc-files \
70                 --enable-sp-funcs \
71                 --enable-warnings \
72                 --enable-wgetch-events \
73                 --enable-widec \
74                 --program-suffix=$(MY_ABI) \
75                 --verbose \
76                 --with-chtype=uint32_t \
77                 --with-mmask_t=uint32_t \
78                 --with-develop \
79                 --with-extra-suffix=$(MY_ABI) \
80                 --with-shared \
81                 --with-termlib \
82                 --with-ticlib \
83                 --with-trace \
84                 --with-cxx-shared \
85                 --with-versioned-syms \
86                 --with-xterm-kbs=DEL \
87                 --without-ada \
88                 --without-debug \
89                 --without-normal
90
91         touch configure-stamp
92
93 build: build-stamp
94 build-stamp: configure-stamp
95         dh_testdir
96
97         $(MAKE)
98
99         touch build-stamp
100
101 clean:
102         dh_testdir
103         dh_testroot
104
105         [ ! -f makefile ] || $(MAKE) distclean
106
107         rm -f configure-stamp build-stamp install-stamp
108
109         dh_clean
110
111 install: install-stamp
112 install-stamp: build-stamp
113         dh_testdir
114         dh_testroot
115         dh_clean -k
116         dh_installdirs
117
118         $(MAKE) install.libs install.progs DESTDIR=$(BUILD_DIR)
119
120         ( cd test && make ncurses LOCAL_LIBDIR=$(MY_DIR)/lib )
121         mv test/ncurses $(BUILD_DIR)$(MY_DIR)/bin/ncurses$(MY_ABI)
122
123         touch install-stamp
124
125 # Build architecture-independent files here.
126 binary-indep: build install
127 # No binary-indep target.
128
129 # Build architecture-dependent files here.
130 binary-arch: build install
131         dh_testdir
132         dh_testroot
133         dh_installchangelogs NEWS
134         dh_strip
135         dh_compress
136         dh_fixperms
137         dh_installdeb
138         dh_makeshlibs
139         dh_shlibdeps
140         dh_gencontrol
141         dh_md5sums
142         dh_builddeb
143
144 binary: binary-indep binary-arch
145 .PHONY: build clean binary-indep binary-arch binary install install-stamp