#!/usr/bin/make -f

DATE := $(shell date -u -d "$$(dpkg-parsechangelog -SDate)" +"%Y/%m/%d")

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

CPPFLAGS+=-DBUILD_DATE='"$(DATE)"'
CXXFLAGS+=-std=c++11

%:
	dh $@

override_dh_autoreconf:
	./autogen.sh
	dh_autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --target=linux

override_dh_auto_test:
	@echo home: $(HOME)
	HOME=/tmp dh_auto_test -a || (grep . test-suite.log giada_test.log; false)

override_dh_auto_clean:
	dh_auto_clean
	test -e src/deps/rtaudio-mode/Makefile && make -C src/deps/rtaudio-mod/ distclean || true

## all the file-exclusion magic is handled by debian/copyright
get-orig-source:
	uscan  --download
