#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
	dh $@ --sourcedirectory=sources

override_dh_auto_build:
	dpkg-architecture -f -a$(DEB_BUILD_ARCH) -c dh_auto_build -- LINKER='$$(CXX)'
	help2man -h "-h" -n ELPH --version-string=1.0.1 --no-discard-stderr  sources/elph > debian/elph.1
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	dh_auto_clean
	dh_auto_build -- LINKER='$$(CXX)'
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/elph.1
