#!/usr/bin/make -f
export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS += $(CPPFLAGS)
CXXFLAGS += $(CPPFLAGS)

%:
	dh $@

override_dh_clean:
	dh_clean
	rm -rf debian/tmp
	rm -f debian/lm4flash.1
	dh_auto_clean -D lm4flash/
	dh_auto_clean -D lmicdiusb/

override_dh_auto_build:
	dh_auto_build -D lm4flash
	dh_auto_build -D lmicdiusb

override_dh_auto_install:
	dh_auto_install -- PREFIX=$$\{DESTDIR\}

override_dh_installman:
	help2man -n "Command-line firmware flashing tool to communicate with the Stellaris Launchpad" \
		lm4flash/lm4flash > debian/lm4flash.1
	dh_installman
