#!/usr/bin/make -f

CROSS_COMPILE:=$(DEB_HOST_GNU_TYPE)-

O:=$(CURDIR)/${KERNEL_BUILD_DIR}
S:=$(CURDIR)
deb_top_dir:=$(S)/debian

# Dynamic variables to be passed to Isar build scripts
isar_env=$(strip \
	export CROSS_COMPILE='$(CROSS_COMPILE)' && \
	export DEB_BUILD_PROFILES='$(DEB_BUILD_PROFILES)' && \
	export DEB_HOST_GNU_TYPE='$(DEB_HOST_GNU_TYPE)' && \
	export MAKE='$(MAKE)' && \
	export O='${O}' && \
	export S='${S}' \
)

%:
	dh $(@)

override_dh_auto_clean:
	$(isar_env) && bash $(deb_top_dir)/isar/clean

override_dh_auto_build:
	$(isar_env) && bash $(deb_top_dir)/isar/build

override_dh_auto_install:
	$(isar_env) && bash $(deb_top_dir)/isar/install

override_dh_auto_test:
	true

override_dh_strip:
	unset DEB_HOST_GNU_TYPE && dh_strip -Xvmlinu --no-automatic-dbgsym
