#!/usr/bin/make -f

DH_VERBOSE = 1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

%:
ifeq (mipsel,$(findstring mipsel,$(DEB_HOST_ARCH)))
	dh $@ --no-parallel
else ifeq (mips64el,$(findstring mips64el,$(DEB_HOST_ARCH)))
	dh $@ --no-parallel
else
	dh $@
endif

override_dh_auto_clean:
	# only try to run dh_auto_clean if configure has been run
	test -f Makefile.conf && dh_auto_clean || true

override_dh_auto_configure:
	./configure \
		--LDFLAGS='$(LDFLAGS)' \
		--CFLAGS='$(CFLAGS) $(CPPFLAGS)' \
		\
		--symbols \
		--prefix=/usr \
		--confdir=/etc/camv-rnd \
		--prefix/libs/script/fungw=/dev/null \
		\
		--all=disable \
		--buildin-io_tedax \
		--buildin-std_tools \
		--buildin-dialogs \
		--plugin-export_png \
		--plugin-import_excellon \
		--plugin-export_svg \
		--plugin-export_lpr \
		--plugin-gui \
		--plugin-import_gcode \
		--plugin-import_gerb \
		--plugin-export_ps \
