#!/usr/bin/make -f
install-dir = "$(shell pwd)/debian/brewtarget"

override_dh_auto_configure:
	cp debian/images/*.png images
	if ! test -d build; then mkdir build; fi
	if ! test -d build/cmake; then mkdir build/cmake; fi
	cd build/cmake; \
	cmake ../../ -DDO_RELEASE_BUILD=ON -DCMAKE_INSTALL_PREFIX=$(install-dir) -DEXEC_PREFIX=usr

override_dh_auto_build:
	cd build/cmake; \
	make

override_dh_auto_install:
	cd build/cmake; \
	make install

override_dh_clean:
	dh_clean
	if test -d build/cmake; then rm -r build/cmake; fi
	if test -e src/config.h; then rm src/config.h; fi
	if test -d debian/brewtarget; then rm -r debian/brewtarget; fi
	rm -f images/flag*.png images/restore.png

%:
	dh $@

