]> ncurses.scripts.mit.edu Git - ncurses.git/blob - package/debian/rules
ncurses 5.9 - patch 20140301
[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_DIR=/usr/local/ncurses6
18 MYDATA=/usr/local/ncurses/share/terminfo
19 BUILD_DIR=$(CURDIR)/debian/ncurses6
20
21 CFLAGS = $(CC_NORMAL)
22
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
29         INSTALL_PROGRAM += -s
30 endif
31
32
33 configure: configure-stamp
34 configure-stamp:
35         dh_testdir
36
37         RPATH_LIST=../lib:$(MY_DIR)/lib \
38         CFLAGS="$(CFLAGS)" ./configure \
39                 --host=$(DEB_HOST_GNU_TYPE) \
40                 --build=$(DEB_BUILD_GNU_TYPE) \
41                 --prefix=$(MY_DIR) \
42                 --with-default-terminfo-dir=$(MYDATA) \
43                 --with-terminfo-dirs=$(MYDATA):/usr/share/terminfo \
44                 --disable-echo \
45                 --disable-getcap \
46                 --disable-leaks \
47                 --disable-macros  \
48                 --disable-termcap \
49                 --enable-const \
50                 --enable-ext-colors \
51                 --enable-ext-mouse \
52                 --enable-hard-tabs \
53                 --enable-interop \
54                 --enable-rpath \
55                 --enable-sp-funcs \
56                 --enable-warnings \
57                 --enable-widec \
58                 --verbose \
59                 --with-develop \
60                 --with-shared \
61                 --with-termlib \
62                 --with-ticlib \
63                 --with-trace \
64                 --with-cxx-shared \
65                 --with-xterm-kbs=DEL \
66                 --without-ada \
67                 --without-debug \
68                 --without-normal
69
70         touch configure-stamp
71
72 build: build-stamp
73 build-stamp: configure-stamp
74         dh_testdir
75
76         $(MAKE)
77
78         touch build-stamp
79
80 clean:
81         dh_testdir
82         dh_testroot
83
84         [ ! -f makefile ] || $(MAKE) distclean
85
86         rm -f configure-stamp build-stamp install-stamp
87
88         dh_clean
89
90 install: install-stamp
91 install-stamp: build-stamp
92         dh_testdir
93         dh_testroot
94         dh_clean -k
95         dh_installdirs
96
97         $(MAKE) install.libs install.progs DESTDIR=$(BUILD_DIR)
98
99         ( cd test && make ncurses LOCAL_LIBDIR=$(MY_DIR)/lib )
100         mv test/ncurses $(BUILD_DIR)$(MY_DIR)/bin/ncurses6
101
102         touch install-stamp
103
104 # Build architecture-independent files here.
105 binary-indep: build install
106 # No binary-indep target.
107
108 # Build architecture-dependent files here.
109 binary-arch: build install
110         dh_testdir
111         dh_testroot
112         dh_installchangelogs NEWS
113         dh_strip
114         dh_compress
115         dh_fixperms
116         dh_installdeb
117         dh_shlibdeps
118         dh_gencontrol
119         dh_md5sums
120         dh_builddeb
121
122 binary: binary-indep binary-arch
123 .PHONY: build clean binary-indep binary-arch binary install install-stamp