#!/usr/bin/make -f

export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
export CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

export ACLOCAL := aclocal -I m4

%:
	dh $@ --with=autoreconf

autoreconf:
	autoreconf -f -i .
	cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub .

override_dh_autoreconf:
	dh_autoreconf debian/rules -- autoreconf

override_dh_installexamples:
	sed -e 's,\(libdir = \$${prefix}/lib\)/.*$$,\1,' < buildsys.mk > buildsys.mk.new
	mv -f buildsys.mk.new buildsys.mk
	dh_installexamples -X.dep

override_dh_compress:
	dh_compress -Xusr/share/doc/libmowgli-dev/examples

override_dh_strip:
	dh_strip --dbg-package=libmowgli2-dbg

.PHONY: override_dh_installexamples override_dh_compress override_dh_strip
