#!/usr/bin/make -f

DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
	CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
else
	CROSS=
endif

export LDFLAGS+=-Wl,-z,defs

%:
	dh $@ --with autotools_dev

override_dh_auto_configure:
	dh_auto_configure -- $(CROSS) --enable-hpadco

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) maintainer-clean
	dh_clean
