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