#!/usr/bin/make -f

# Set to enable verbose output from debhelper
#export DH_VERBOSE=1

# Enable all hardening-related compiler options
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Build sopwith with -O0 optimization to prevent segfaults.
# See http://bugs.debian.org/742295
export DEB_BUILD_OPTIONS=noopt

install_dir = $(CURDIR)/debian/tmp

%:
	dh $@ --with autotools_dev

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(install_dir)

override_dh_auto_clean:
	touch config.status                          # so 'make clean' is happy
	dh_auto_clean
	rm -f config.log config.status               # remove so quilt patches can be reverted
	rm -f src/gtk/Makefile src/psion/Makefile    # remove so repeat builds work properly

