#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

CXXFLAGS+="-I/usr/include/pd"

archconfflags := \
        --prefix=/usr \
	--without-ALL \
	--with-ImageMagick \
	--with-lqt \
	--with-libquicktime \
	--with-gmerlin_avdec \
	--with-libmpeg3 \
	--with-avifile \
	--with-v4l \
	--with-libv4l1 \
	--with-libv4l2 \
	--with-ftgl \
	--with-default-font=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf

%:
	dh $@

override_dh_auto_configure:
	cd src && CXXFLAGS="$(CXXFLAGS)" CFLAGS="$(CFLAGS)" ./configure $(archconfflags)

override_dh_auto_build:
	dh build --before dh_auto_build
	cd src && make
	dh build --after dh_auto_build

override_dh_auto_clean:
	dh clean --before dh_auto_clean
	cd src && [ ! -f Makefile ] || make distclean
	-$(RM) -rf src/Base/configLinux.h
	dh clean --after dh_auto_clean

override_dh_compress:
	dh_compress -X.pd -X.TIF -X.obj

override_dh_fixperms:
	dh_fixperms -Xpd-gem

override_dh_auto_test:
	# no actual 'make test' target
