#!/usr/bin/make -f

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

DEB_BUILD_ARCH := $(shell dpkg --print-architecture)
ARCH=$(DEB_BUILD_ARCH)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Enable hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

ifeq ($(ARCH),alpha)
CXXFLAGS+=-O0 -mieee
else
CXXFLAGS+=-O2
endif

# DEBUGGING FLAGS.
# CXXFLAGS+=-g3 -gstabs+ -fexceptions
# DEB_BUILD_OPTIONS+=nostrip
# export CXXFLAGS
# export DEB_BUILD_OPTIONS

###

%:
	dh $@ --parallel --with autoreconf

override_dh_clean:
	dh_clean -Xautom4te.cache

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-debug \
		--with-qtlibdir=/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_test:

override_dh_strip:
	dh_strip --dbg-package=rosegarden-dbg
