blob: 0adde8de53458dc52ee911a4b584a7dea1d95b5d [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#!/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)
11DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14TARGET_DIR = $(CURDIR)/debian/adacurses
micky3879b9f5e72025-07-08 18:04:53 -040015SAMPLE_DIR = $(TARGET_DIR)/usr/libexec/AdaCurses
Steve Kondikae271bc2015-11-15 02:50:53 +010016
micky3879b9f5e72025-07-08 18:04:53 -040017CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(CC_NORMAL)
18CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
19LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
Steve Kondikae271bc2015-11-15 02:50:53 +010020
21ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22 CFLAGS += -O0
23else
24 CFLAGS += -O2
25endif
26ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
27 INSTALL_PROGRAM += -s
28endif
29
30
31configure: configure-stamp
32configure-stamp:
33 dh_testdir
34
micky3879b9f5e72025-07-08 18:04:53 -040035 CFLAGS="$(CFLAGS)" \
36 CPPFLAGS="$(CPPFLAGS)" \
37 LDFLAGS="$(LDFLAGS)" ./configure \
Steve Kondikae271bc2015-11-15 02:50:53 +010038 --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 --without-pkg-config
45
46 touch configure-stamp
47
48build: build-stamp
49build-stamp: configure-stamp
50 dh_testdir
51
52 $(MAKE)
53
54 touch build-stamp
55
56clean:
57 dh_testdir
58 dh_testroot
59
60 [ ! -f makefile ] || $(MAKE) distclean
61
62 rm -f configure-stamp build-stamp install-stamp
63
64 dh_clean
65
66install: install-stamp
67install-stamp: build-stamp
68 dh_testdir
69 dh_testroot
micky3879b9f5e72025-07-08 18:04:53 -040070 dh_prep
Steve Kondikae271bc2015-11-15 02:50:53 +010071 dh_installdirs
72
73 $(MAKE) install DESTDIR=$(TARGET_DIR)
micky3879b9f5e72025-07-08 18:04:53 -040074
Steve Kondikae271bc2015-11-15 02:50:53 +010075 # FIXME: it would be nice to make these into separate packages
76 ( cd samples && $(MAKE) install.examples DESTDIR=$(TARGET_DIR) BINDIR=$(SAMPLE_DIR) )
77 ( cd doc && $(MAKE) install.html DESTDIR=$(TARGET_DIR) )
78
79 touch install-stamp
80
81# Build architecture-independent files here.
82binary-indep: build install
83# No binary-indep target.
84
85# Build architecture-dependent files here.
86binary-arch: build install
87 dh_testdir
88 dh_testroot
89 dh_installdocs
90 dh_installexamples
91 dh_installchangelogs NEWS
92 dh_strip
93 dh_compress
94 dh_fixperms
95 dh_installdeb
96 dh_makeshlibs
97 dh_shlibdeps
98 dh_gencontrol
99 dh_md5sums
100 dh_builddeb
101
102binary: binary-indep binary-arch
103.PHONY: build clean binary-indep binary-arch binary install install-stamp