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