#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS	= hardening=+all
export DEB_CFLAGS_MAINT_APPEND	= -Wall -pedantic -I.
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

override_dh_clean:
	#   The original sources contain *.orig and *.rej files
	#   that must not be cleaned.
	#   So do *not* run 'dh_clean' commands.

	rm -rf debian/agrep debian/.#* debian/*[~#]
	rm -f debian/files debian/*.log debian/*.substvars
	[ ! -f Makefile ] || $(MAKE) clean

override_dh_auto_build:
	# These are the only variables that are free for user
	$(MAKE) DEBUGFLAGS="$(CFLAGS) $(CPPFLAGS)" OTHERLIBS="$(LDFLAGS)"

override_dh_installchangelogs:
	dh_installchangelogs agrep.chronicle

%:
	dh $@

# End of file
