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

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

%:
	dh $@

BUILD_OPTIONS = \
	-DBOOST_COMPUTE_BUILD_BENCHMARKS=OFF \
	-DBOOST_COMPUTE_ENABLE_COVERAGE=OFF

# Disable build of examples and testsuite if no check requested.
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
BUILD_OPTIONS += \
	-DBOOST_COMPUTE_BUILD_EXAMPLES=ON \
	-DBOOST_COMPUTE_BUILD_TESTS=ON
else
BUILD_OPTIONS += \
	-DBOOST_COMPUTE_BUILD_EXAMPLES=OFF \
	-DBOOST_COMPUTE_BUILD_TESTS=OFF
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf bin doc/bin doc/html
	rm -f Jamroot doc/*.jam doc/*.xml

override_dh_auto_configure:
	dh_auto_configure -- $(BUILD_OPTIONS)

override_dh_auto_build:
	dh_auto_build
	echo 'project compute : ;' > Jamroot
	cd doc && \
	printf "using boostbook ;\nusing quickbook ;\nusing doxygen ;" >> ./user-config.jam  && \
	bjam --v2 --user-config=./user-config.jam html

override_dh_auto_test:
	# No-op.

override_dh_compress:
	dh_compress --exclude=examples
