#!/usr/bin/make -f

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
export DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)

confflags := --enable-doxygen-doc

# enable bdjava on linux hosts only
ifneq (,$(findstring linux,$(DEB_BUILD_ARCH_OS)))
confflags += --enable-bdjava
endif

# Set CFLAGS to DEB_CFLAGS
CFLAGS=$(DEB_CFLAGS)

ifneq (,$(findstring linux,$(DEB_BUILD_ARCH_OS)))
%:
	dh --with javahelper,autoreconf $@
else
%:
	dh --with autoreconf $@
endif

override_dh_auto_configure:
	dh_auto_configure -- $(confflags)

override_dh_auto_build:
	dh_auto_build
	make doxygen-doc

override_dh_installdocs:
	dh_installdocs --exclude=jquery.js

override_dh_clean:
	dh_clean
	rm -rf src/libbluray/bdj/build

get-orig-source:
	$(dir $_)libbluray-get-orig-source
