#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# need -fcommon to fix #957756. gcc-10 flipped the default to -fno-common, which
# makes the build fail. Upstream has just fixed this properly, so please remove
# the -fcommon thing when packaging a later version
# https://github.com/rocky/remake/issues/109
export DEB_CFLAGS_MAINT_APPEND += -fcommon

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure $@ -- --disable-nls --enable-maintainer-mode

# do not ship conflicting /usr/include/gnumake.h. This lives in the 'make'
# package, which has a library component. There's no reason to do this with
# remake, so I simply remove it
override_dh_install:
	rm -rf debian/remake/usr/include
	dh_install

# This test is a known failure in 4.3. Upstream will try to fix it for 4.4.
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1108812
# https://github.com/Trepan-Debuggers/remake/issues/168
override_dh_auto_test:
	rm -f tests/scripts/features/output-sync
	dh_auto_test
