#!/usr/bin/make -f

PACKAGE = ifile

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

# The only place where to inject additional flags
export CC := $(CC) $(CPPFLAGS) $(LDFLAGS)

override_dh_auto_clean:
	# Override because Makefile has no target 'distclean'. See next target.
	rm -f config.*

override_dh_clean:
	# Standard clean would cause to run 'configure' again (autotools)
	# Manual cleaning.
	rm -rf debian/$(PACKAGE)
	rm -f					\
	Makefile				\
	argp/Makefile				\
	config.status				\
	config.log				\
	argp/config.status			\
	argp/config.log				\
	*.o					\
	*.a					\
	debian/*.log				\
	debian/*.substvars			\
	debian/files				\
	argp/*.o				\
	ifile

override_dh_auto_configure:
	cp -vf /usr/share/misc/config.sub .
	cp -vf /usr/share/misc/config.guess .
	dh_testdir
	dh_auto_configure

override_dh_auto_test:
	# Nothing to do. Would cause to run 'configure'

%:
	dh $@

# End of file
