#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS   = hardening=+all
export DEB_CFLAGS_MAINT_APPEND   = -fdiagnostics-color=always #-fcolor-diagnostics #-Wall #-pedantic
export DEB_CXXFLAGS_MAINT_APPEND = -fdiagnostics-color=always #-fcolor-diagnostics #-Wall #-pedantic
export DEB_LDFLAGS_MAINT_APPEND  = -Wl,--as-needed
export CLICOLOR_FORCE=ON

%:
	dh $@ -Scmake+ninja

# https://intel.github.io/mkl-dnn/dev_guide_build_options.html
override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DMKLDNN_ARCH_OPT_FLAGS="" \
		-DDNNL_GPU_RUNTIME=OCL \
		-DDNNL_INSTALL_MODE=DEFAULT

override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	dh_auto_build -- doc
endif

override_dh_auto_test:
	dh_auto_test || true

override_dh_missing:
	dh_missing --fail-missing

override_dh_installdocs:
	dh_installdocs -A doc/legal_information.md
	-dh_doxygen
