#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND=-I/usr/include/seqan3/submodules/sdsl-lite/include/ -I/usr/include/simde -I${CURDIR}/lib/submodules/sharg-parser/include/ -I${CURDIR}/lib/submodules/lemon/include/
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DRAPTOR_NATIVE_BUILD=OFF

override_dh_auto_build-arch:
	dh_auto_build --arch
	obj-*/bin/raptor --export-help man > debian/raptor.1
	obj-*/bin/raptor build --export-help man > debian/raptor-build.1
	obj-*/bin/raptor search --export-help man > debian/raptor-search.1
	obj-*/bin/raptor socks --export-help man > debian/raptor-socks.1
	obj-*/bin/raptor socks build --export-help man > debian/raptor-socks-build.1
	obj-*/bin/raptor socks lookup-kmer --export-help man > debian/raptor-socks-lookup-kmer.1
	obj-*/bin/raptor upgrade --export-help man > debian/raptor-upgrade.1

override_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	cd obj-* && $(MAKE) doc && cd doc/latex && $(MAKE)
endif

### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
#override_dh_auto_test:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	do_stuff_for_testing
#endif
