#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --parallel

# --symbols is to build with -g
#
# I link everything into the main program (--buildin-...) including the
# user-interface: gtk. At some point I may add lesstif as an option. Then
# shipping those as separate plugins would make sense.
#
# I disable gpmi, export_openscad, export_dxf because upstream says
# that they don't yet work in a useful way
#
# bison and export_bboard cause build issues
override_dh_auto_configure:
	./configure				\
           --symbols				\
           --all=buildin			\
           --prefix=/usr			\
						\
           --LDFLAGS='$(LDFLAGS)'		\
           --CFLAGS='$(CFLAGS) $(CPPFLAGS)'

# currently upstream has a bug where 'make clean' leaves behind some files. I
# explicitly kill them here. Bug reported upstream on IRC.
#
# I forcibly keep README.orig. The debian-specific 'dh' tool cleans out all
# .orig files, but this is a part of the upstream sources here
override_dh_clean:
	dh_clean -XREADME.orig
	rm -f src_plugins/dbus/dbus-introspect.h
	find . -name '*.o' -delete

# I want packages to go here regardless of how many packages I'm building
override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp
