#!/usr/bin/make -f
# export DH_VERBOSE=1

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

%:
	dh $@ --parallel --dbg-package=libtbb2-dbg

VERSION = $(shell dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d-)

override_dh_auto_build:
			sed -e"s/@VERSION@/$(VERSION)/g" debian/tbb.pc.in > debian/tbb.pc
			dh_auto_build

# Makefiles should not be compressed (tbb-examples)
override_dh_compress-indep:
	dh_compress -X*/examples/*

get-orig-source:
	uscan --verbose --force-download --rename

override_dh_auto_clean:
	dh_auto_clean
	touch debian/tbb.pc && rm debian/tbb.pc
