#!/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) $(RM) compile test-driver .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