#!/usr/bin/make -f SHELL+= -e DPKG_EXPORT_BUILDFLAGS=1 DEB_BUILD_MAINT_OPTIONS=hardening=+pie,+bindnow -include /usr/share/dpkg/buildflags.mk # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979662 CPPFLAGS+=-DLIBBSD_OPENBSD_VIS CFLAGS+=$(shell pkg-config --cflags libbsd-overlay) LDFLAGS+=$(shell pkg-config --libs libbsd-overlay) CFLAGS+=$(shell pkg-config --cflags libbsd-ctor) LDFLAGS+=$(shell pkg-config --libs libbsd-ctor) -include /usr/share/dpkg/architecture.mk DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) else CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) #TEST_TARGET=test endif D := $(CURDIR)/debian/ladvd ############################################################################## configure: configure.ac dh_autoreconf build/config.status: configure dh_testdir mkdir -p build cd build && \ ../configure $(CONFFLAGS) \ --disable-silent-rules \ --prefix=/usr --mandir=\$${prefix}/share/man \ --with-systemdsystemunitdir=/lib/systemd/system \ --with-pid-dir=/run/ladvd build: build-stamp build-stamp: build/config.status dh_testdir cd build && \ $(MAKE) touch $@ test: test-stamp test-stamp: build dh_testdir cd build && \ $(MAKE) check touch $@ clean: dh_testdir rm -rf *-stamp build dh_autoreconf_clean dh_clean binary-arch: build $(TEST_TARGET) dh_testdir dh_testroot dh_prep cd build && \ $(MAKE) install DESTDIR=$D rm $D/usr/share/doc/ladvd/LICENSE dh_installchangelogs dh_installdocs dh_installsystemd dh_installman dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-indep: binary: binary-indep binary-arch build-arch: build build-indep: build .PHONY: clean build build-arch build-indep binary binary-indep binary-arch