| 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 |
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) |
| 15 |
CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS) |
| 16 |
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) |
| 17 |
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) |
| 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)" \ |
| 34 |
CPPFLAGS="$(CPPFLAGS) -DLCOV_UNUSED" \ |
| 35 |
LDFLAGS="$(LDFLAGS)" ./configure \ |
| 36 |
--host=$(DEB_HOST_GNU_TYPE) \ |
| 37 |
--build=$(DEB_BUILD_GNU_TYPE) \ |
| 38 |
--program-suffix=-cur \ |
| 39 |
--prefix=/usr \ |
| 40 |
--mandir=\$${prefix}/share/man \ |
| 41 |
--sysconfdir=/etc |
| 42 |
|
| 43 |
touch configure-stamp |
| 44 |
|
| 45 |
build: build-stamp |
| 46 |
build-stamp: configure-stamp |
| 47 |
dh_testdir |
| 48 |
|
| 49 |
$(MAKE) |
| 50 |
|
| 51 |
touch build-stamp |
| 52 |
|
| 53 |
clean: |
| 54 |
dh_testdir |
| 55 |
dh_testroot |
| 56 |
|
| 57 |
[ ! -f Makefile ] || $(MAKE) clean |
| 58 |
|
| 59 |
rm -f configure-stamp build-stamp install-stamp \ |
| 60 |
config.cache config.h config.status config.log makefile |
| 61 |
|
| 62 |
rm -f *.o mawk |
| 63 |
|
| 64 |
dh_clean |
| 65 |
|
| 66 |
install: install-stamp |
| 67 |
install-stamp: build-stamp |
| 68 |
dh_testdir |
| 69 |
dh_testroot |
| 70 |
dh_prep |
| 71 |
dh_installdirs |
| 72 |
|
| 73 |
$(MAKE) install DESTDIR=$(CURDIR)/debian/mawk-cur |
| 74 |
|
| 75 |
touch install-stamp |
| 76 |
|
| 77 |
# Build architecture-independent files here. |
| 78 |
binary-indep: build install |
| 79 |
# No binary-indep target. |
| 80 |
|
| 81 |
# Build architecture-dependent files here. |
| 82 |
binary-arch: build install |
| 83 |
dh_testdir |
| 84 |
dh_testroot |
| 85 |
dh_installdocs |
| 86 |
dh_installexamples |
| 87 |
dh_installchangelogs CHANGES |
| 88 |
dh_strip |
| 89 |
dh_compress |
| 90 |
dh_fixperms |
| 91 |
dh_installdeb |
| 92 |
dh_shlibdeps |
| 93 |
dh_gencontrol |
| 94 |
dh_md5sums |
| 95 |
dh_builddeb |
| 96 |
|
| 97 |
binary: binary-indep binary-arch |
| 98 |
.PHONY: build clean binary-indep binary-arch binary install install-stamp |