#! /usr/bin/make -f

%:
	dh $@

# I think this makes the application more robust in face of badly set
# PATH, since external programs are looked up with absolute paths. 
# On the contrary, it is less hackable by who knows what he is doing.
FLAVOUR=abspath/gnome2/

override_dh_auto_build:
	$(MAKE) $(FLAVOUR)all PREFIX=usr H= \
		CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
		LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"

	# Use this after weezy
	#	$(shell dpkg-buildflags --export=configure)
	
override_dh_auto_install:
	$(MAKE) $(FLAVOUR)install DESTDIR=debian/tmp PREFIX=usr H=

override_dh_auto_test:
	VALGRIND=" " $(MAKE) --no-print-directory $(FLAVOUR)test PREFIX=usr H=

override_dh_auto_clean:
	dh_auto_clean
	rm -f smd-config.h
