#! /usr/bin/make -f

export DH_OPTIONS

## use hardening some flags
DPKG_EXPORT_BUILDFLAGS = 1
DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_BUILD_MAINT_OPTIONS

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

#ifneq (,$(filter-out $(DEB_HOST_ARCH), alpha hppa arm))
#	HARD_CFLAGS += -fstack-protector --param ssp-buffer-size=4
#endif
#ifneq (,$(filter-out $(DEB_HOST_ARCH), ia64 hppa avr32))
#	HARD_LDFLAGS += -Wl,-z,relro
#endif
#
## Keep dpkg-buildpackage the hell out of messing with our compile flags,
## we should trust upstream to know better than it what to use here.
## We do append -g for release builds though, for the detached -dbg package,
## and also now the hardening flags too as appropriate.
#CPPFLAGS = $(HARD_CPPFLAGS)
#CFLAGS   = $(HARD_CFLAGS) -g
#CXXFLAGS = $(HARD_CFLAGS) -g
#LDFLAGS  = $(HARD_LDFLAGS)

%:
	dh $@

override_dh_strip:
	dh_strip --dbgsym-migration="libogg-dbg (<< 1.3.4-2~)"

licensecheck:
	licensecheck --deb-machine -r * \
                > debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
                && rm debian/copyright_newhints
