#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_clean:
	if [ -s Makefile ]; then $(MAKE) clean || true; fi

#override_dh_makeshlibs:
#	dh_makeshlibs -V

build-indep:
	## Make doc - it seems to be necessary to build it like this:
	cd doc/text && \
            pdflatex crc.tex && bibtex crc        ;\
            pdflatex crc.tex && pdflatex crc.tex

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

# gracefully handle stripping if -dbg package (un-)commented in debian/control
override_dh_strip:
	[ -d "$(CURDIR)/debian/libcrcutil-dbg" ] \
        && dh_strip --dbg-package=libcrcutil-dbg \
        || dh_strip
