]> ncurses.scripts.mit.edu Git - ncurses.git/blob - package/debian/rules
ncurses 5.9 - patch 20140419
[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-chtype=uint32_t \
60                 --with-mmask_t=uint32_t \
61                 --with-develop \
62                 --with-shared \
63                 --with-termlib \
64                 --with-ticlib \
65                 --with-trace \
66                 --with-cxx-shared \
67                 --with-xterm-kbs=DEL \
68                 --without-ada \
69                 --without-debug \
70                 --without-normal
71
72         touch configure-stamp
73
74 build: build-stamp
75 build-stamp: configure-stamp
76         dh_testdir
77
78         $(MAKE)
79
80         touch build-stamp
81
82 clean:
83         dh_testdir
84         dh_testroot
85
86         [ ! -f makefile ] || $(MAKE) distclean
87
88         rm -f configure-stamp build-stamp install-stamp
89
90         dh_clean
91
92 install: install-stamp
93 install-stamp: build-stamp
94         dh_testdir
95         dh_testroot
96         dh_clean -k
97         dh_installdirs
98
99         $(MAKE) install.libs install.progs DESTDIR=$(BUILD_DIR)
100
101         ( cd test && make ncurses LOCAL_LIBDIR=$(MY_DIR)/lib )
102         mv test/ncurses $(BUILD_DIR)$(MY_DIR)/bin/ncurses6
103
104         touch install-stamp
105
106 # Build architecture-independent files here.
107 binary-indep: build install
108 # No binary-indep target.
109
110 # Build architecture-dependent files here.
111 binary-arch: build install
112         dh_testdir
113         dh_testroot
114         dh_installchangelogs NEWS
115         dh_strip
116         dh_compress
117         dh_fixperms
118         dh_installdeb
119         dh_shlibdeps
120         dh_gencontrol
121         dh_md5sums
122         dh_builddeb
123
124 binary: binary-indep binary-arch
125 .PHONY: build clean binary-indep binary-arch binary install install-stamp