]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/package/debian/rules
ncurses 5.8 - patch 20110326
[ncurses.git] / Ada95 / 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 TARGET_DIR = $(CURDIR)/debian/adacurses
15 SAMPLE_DIR = $(TARGET_DIR)/usr/bin/AdaCurses
16
17 CFLAGS =
18
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20         CFLAGS += -O0
21 else
22         CFLAGS += -O2
23 endif
24 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
25         INSTALL_PROGRAM += -s
26 endif
27
28
29 configure: configure-stamp
30 configure-stamp:
31         dh_testdir
32
33         CFLAGS="$(CFLAGS)" ./configure \
34                 --host=$(DEB_HOST_GNU_TYPE) \
35                 --build=$(DEB_BUILD_GNU_TYPE) \
36                 --prefix=/usr \
37                 --with-ada-sharedlib
38
39         touch configure-stamp
40
41 build: build-stamp
42 build-stamp: configure-stamp
43         dh_testdir
44
45         $(MAKE)
46
47         touch build-stamp
48
49 clean:
50         dh_testdir
51         dh_testroot
52
53         [ ! -f makefile ] || $(MAKE) distclean
54
55         rm -f configure-stamp build-stamp install-stamp
56
57         dh_clean
58
59 install: install-stamp
60 install-stamp: build-stamp
61         dh_testdir
62         dh_testroot
63         dh_clean -k
64         dh_installdirs
65
66         $(MAKE) install DESTDIR=$(TARGET_DIR)
67         
68         # FIXME: it would be nice to make these into separate packages
69         ( cd samples && $(MAKE) install.examples DESTDIR=$(TARGET_DIR) )
70         ( cd doc && $(MAKE) install.html DESTDIR=$(TARGET_DIR) )
71
72         touch install-stamp
73
74 # Build architecture-independent files here.
75 binary-indep: build install
76 # No binary-indep target.
77
78 # Build architecture-dependent files here.
79 binary-arch: build install
80         dh_testdir
81         dh_testroot
82         dh_installdocs
83         dh_installexamples
84         dh_installchangelogs NEWS
85         dh_strip
86         dh_compress
87         dh_fixperms
88         dh_installdeb
89         dh_shlibdeps
90         dh_gencontrol
91         dh_md5sums
92         dh_builddeb
93
94 binary: binary-indep binary-arch
95 .PHONY: build clean binary-indep binary-arch binary install install-stamp