#!/usr/bin/make -f

export ZLIB = -lz
export LDFLAGS = -lm -lpthread -ldl `dpkg-buildflags --get LDFLAGS`

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND = -DSTABLE_BUILD -DDYNAMIC_ZLIB

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -f plink1.9
	rm -f plink1.9.1

override_dh_auto_build:
	dh_auto_build
	mv plink plink1.9
# help2man 1.47.13 is not able anymore do generate a clean manpage for plink1.9
# which lead to several lintian warnings and more annoying the auto-generated
# manpage is installed by debhelper in the wrong section due to
# https://bugs.debian.org/958343
#	help2man --no-discard-stderr --name="whole genome SNP analysis" ./plink1.9 > plink1.9.1

override_dh_auto_install:

override_dh_installman:
	dh_installman debian/plink1.9.1

override_dh_installchangelogs:
	dh_installchangelogs debian/upstream.docs/upstream.changelog

# Upstream provides unversioned download thus we need to read the version out of the source code
get-orig-source:
	. debian/get-orig-source
