#!/usr/bin/make -f

# export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all reproducible=-fixfilepath,-fixdebugpath optimize=-lto

VENDOR=$(shell lsb_release -is)
ifeq ($(VENDOR)-$(DEB_HOST_ARCH),Ubuntu-ppc64el)
  export DEB_CFLAGS_MAINT_STRIP = -O3
  export DEB_CXXFLAGS_MAINT_STRIP = -O3
  export DEB_CFLAGS_MAINT_APPEND = -O2
  export DEB_CXXFLAGS_MAINT_APPEND = -O2
endif

%:
	dh $@ --max-parallel=1

override_dh_auto_build:
	dh_auto_build --max-parallel=2

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-single-host \
		--enable-trust-c-tco \
		--enable-dynamic-clib \
		--enable-shared \
		--disable-absolute-shared-libs \
		--enable-versioned-shared-libs \
		--enable-openssl \
		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)/gambit
