#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

export USE_SYSTEM_ASIO = yes
export USE_SYSTEM_FFTW = yes

# Removes the NORELEASE_WARNING banner.
export BRANCH_NAME = master

# Use Debian package version for plugin version.
export GITCOMMITHASH = $(shell dpkg-parsechangelog -SVersion)
%:
	dh $@

override_dh_auto_clean:
	if [ -f config.mk ]; then \
		$(MAKE) clean; \
	fi

override_dh_auto_install:
	dh_auto_install
	# Remove development scripts
	rm -f debian/openmha/usr/bin/thismha.sh
override_dh_installexamples:
	dh_installexamples
	# Remove VCS control files from installed examples
	find debian/openmha/usr/share/doc/openmha/examples -name '.gitignore' -delete
