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