#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

# skip wasting 2.3 GB for dbgsym pkg
#export DH_BUILD_MAINT_OPTIONS=noddebs
export DEB_DH_STRIP_ARGS := --no-automatic-dbgsym

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# for src/ext/PBA/SparseBundleCPU.cpp
ifeq (,$(filter $(DEB_HOST_ARCH), arm64))
    DEB_CPPFLAGS_MAINT_APPEND += -DDISABLE_CPU_NEON
endif
#ifeq (,$(filter $(DEB_HOST_ARCH), amd64))
#    DEB_CPPFLAGS_MAINT_APPEND += -DDISABLE_CPU_SSE
#endif
export DEB_CPPFLAGS_MAINT_APPEND

%:
	dh $@

#override_dh_auto_configure:
#	dh_auto_configure -- \
#	-DSuiteSparse_AMD_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_AMD_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_CAMD_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_CCOLAMD_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_CHOLMOD_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_COLAMD_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_Config_INCLUDE_DIR=/usr/include/suitesparse/suitesparse \
#	-DSuiteSparse_SPQR_INCLUDE_DIR=/usr/include/suitesparse/suitesparse

#override_dh_auto_test:
#	@echo skipping test

override_dh_auto_install:
	@echo skipping install
