1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#!/usr/bin/make -f
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
configure_flags = --prefix=/usr
configure_flags += --build $(DEB_BUILD_GNU_TYPE)
ifneq "$(DEB_BUILD_GNU_TYPE)" "$(DEB_HOST_GNU_TYPE)"
configure_flags += --host $(DEB_HOST_GNU_TYPE)
endif
configure_flags += $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --export=configure)
n_jobs = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
parallel = -j$(or $(n_jobs),1)
manpage_sources = $(wildcard debian/manpages/*.rst)
manpages = $(manpage_sources:.rst=.1)
.PHONY: clean
clean:
dh_clean
rm -rf obj/
rm -rf $(manpages)
.PHONY: build build-arch build-indep
build build-arch build-indep: obj/build-stamp
ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" ""
build build-arch build-indep: obj/test-stamp
endif
obj/autoconf-stamp: configure.ac
dh_testdir
autoreconf -vfi
mkdir -p $(dir $@)
touch $(@)
obj/config.status: obj/autoconf-stamp
dh_testdir
cd obj/ && ../configure $(configure_flags)
%.1: %.rst
rst2man $(<) $(@)
obj/build-stamp: obj/config.status $(manpages)
dh_testdir
$(MAKE) -C obj/ $(parallel)
touch $(@)
obj/test-stamp: obj/build-stamp
$(MAKE) -C obj/test/ check
touch $(@)
.PHONY: binary binary-arch binary-indep
binary: binary-arch binary-indep
obj/install-stamp: obj/build-stamp
dh_testdir
$(MAKE) -C obj/ install DESTDIR=$(CURDIR)/debian/tmp
touch $(@)
binary-arch: obj/install-stamp
dh_testdir
dh_testroot
dh_prep -a -X tmp
dh_install -a --fail-missing
dh_installdocs -a
dh_installchangelogs -a
dh_installman
dh_compress -a
dh_fixperms -a
dh_strip -a
dh_shlibdeps -a
dh_installdeb -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary-indep: obj/install-stamp
dh_testdir
dh_testroot
dh_prep -i -X tmp
dh_install -i --fail-missing
dh_installdocs -i
dh_installchangelogs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
.SECONDARY:
.NOTPARALLEL:
# vim:ts=4 sw=4 noet
|