#!/usr/bin/make -f

ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
export DH_VERBOSE=1
export V=1
export VERBOSE=1
endif

LC_ALL:=C.UTF-8
export LC_ALL
TZ:=UTC
export TZ

OUR_CPPFLAGS:=
OUR_CFLAGS:=
OUR_CXXFLAGS:=
OUR_LDFLAGS:=

# unclutter build log; these are upstream’s to fix
OUR_CFLAGS+=	-Wno-deprecated-declarations
OUR_CXXFLAGS+=	-Wno-deprecated-declarations
OUR_CXXFLAGS+=	-Wno-deprecated-copy

#XXX TODO: drop with new upstream version (once merged)
# cf. debian/patches/fix-build.diff
OUR_CFLAGS+=	-ffloat-store
OUR_CXXFLAGS+=	-ffloat-store

# only needed when backporting to buster and older
#OUR_LDFLAGS+=	-Wl,--as-needed

dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
export DEB_BUILD_MAINT_OPTIONS:=hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
export DEB_CXXFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CXXFLAGS})
export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
include /usr/share/dpkg/buildflags.mk
ifneq (,$(wildcard /usr/share/dpkg/buildtools.mk))
include /usr/share/dpkg/buildtools.mk
endif

%:
	dh $@ -Dsources

# No dbgsym packages:
override_dh_strip:
	dh_strip --no-automatic-dbgsym
