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