#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# compile with libtbb-dev on linux intel/ppc architectures
arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH | egrep "(amd64|i386|ia64|ppc64)")
os = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS | grep linux)

with_tbb := no
ifeq ($(and $(if $(os),good), $(if $(arch),good)), good)
	with_tbb := yes
endif


%:
	dh $@

# add WITH_TBB as parameter to make
override_dh_auto_build:
	dh_auto_build -- WITH_TBB=$(with_tbb)

# add WITH_TBB as parameter to make install
override_dh_auto_install:
	dh_auto_install -- WITH_TBB=$(with_tbb)

# install CHANGES as changelog
override_dh_installchangelogs:
	dh_installchangelogs CHANGES
