#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# The buildflags are injected by dh_auto_build, but the CFLAGS+=CPPFLAGS happens
# one layer outside, so the CPPFLAGS there are likely empty..
# By adding the include after the DEB_BUILD_MAINT_OPTIONS assignment and before
# the CFLAGS assignment, the variables are initialised in time.
include /usr/share/dpkg/buildflags.mk

# the makefile ignores CPPFLAGS, so add them to CFLAGS
export CFLAGS += $(CPPFLAGS)

# the Makefile uses the cross-prefix in a non-standard way, so "enforce" it:
export CROSS_PREFIX=$(DEB_HOST_GNU_TYPE)-

%:
	dh $@


override_dh_auto_clean:
	dh_auto_clean
	rm -f host-qjsc

override_dh_auto_install:
	export PREFIX=/usr; \
		dh_auto_install

override_dh_auto_test:
	@echo ToDo, skip tests
