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

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

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/architecture.mk
# Needed to silence a GCS warning, which triggered a test failure on arm64:
#   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1120418
ifeq ($(DEB_HOST_ARCH),arm64)
  export DEB_LDFLAGS_MAINT_APPEND := -Wl,-z,gcs-report-dynamic=none
endif

%:
	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
