#!/usr/bin/make -f

# output every command that modifies files on the build system.
#DH_VERBOSE = 1

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

export DEB_CFLAGS_MAINT_APPEND+= -Wdate-time
export DEB_CXXFLAGS_MAINT_APPEND+= -Wdate-time

export SOURCE_DATE_EPOCH_STR ?= $(shell TZ=UTC date -d "$$(dpkg-parsechangelog -SDate)" +'%Y-%m-%d %H:%M:%S')
export DEB_CFLAGS_MAINT_APPEND += -DDEB_BUILD_DATE=\"$$SOURCE_DATE_EPOCH_STR\"
export DEB_CXXFLAGS_MAINT_APPEND += -DDEB_BUILD_DATE=\"$$SOURCE_DATE_EPOCH_STR\"

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- --disable-nls --enable-darkmod-plugins

override_dh_makeshlibs:
	# do not call ldconfig in postinst/postrm
	dh_makeshlibs --noscripts
