#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

BASE_CFLAGS = -Wall -Wextra

# Check whether it is one of the architecture that needs the "-ffloat-store"
# hack to make standard the behavior of its floating point rounding
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
ifneq (,$(findstring $(DEB_HOST_ARCH_CPU),"i386 m68k"))
	BASE_CFLAGS += -ffloat-store
endif


ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	export DEB_CFLAGS_MAINT_APPEND = -O3 $(BASE_CFLAGS)
else
	export DEB_CFLAGS_MAINT_APPEND = $(BASE_CFLAGS)
endif
export DEB_LDFLAGS_MAINT_APPEND=-Wl,-Bsymbolic-functions
export DEB_BUILD_MAINT_OPTIONS=hardening=-pie,+format,+relro,+bindnow

%:
	dh  $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_installdocs:
	dh_installdocs --link-doc=libxdffileio0

override_dh_strip:
	dh_strip --dbg-package=libxdffileio0-dbg

