#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# FIXME: This is discouraged ... but works for the moment to solve bug #957194
#        https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common#The_-fcommon_workaround_.28discouraged.29
export DEB_CFLAGS_MAINT_APPEND=-fcommon

%:
	dh $@ --sourcedirectory=4.1P/src

override_dh_clean:
	dh_clean -- allclean
	find 4.1P/src -executable -type f -delete

override_dh_auto_build:
	dh_auto_build -- CFLAGS="$(CFLAGS)" DEBIANLDFLAGS="$(LDFLAGS)"

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	echo "There is no test suite provided but automatism is grabbing check.c for the check which fails."
endif

get-orig-source:
	sh debian/get-orig-source
