#!/usr/bin/make -f

# We build a firmware, so we do not link to the ssp libraries
export DEB_BUILD_MAINT_OPTIONS = hardening=-stackprotector

# We build a minimalistic cross powerpc-elf toolchain in order to be able
# to build the firmware on all architectures. It might be possible to
# use the native toolchain when building on a powerpc machine, but we don't
# that to make debian/rules simpler, but also because we want the build to
# be reproducible.
include debian/cross-toolchain.mk
export CROSS_COMPILE="$(toolchain_dir)/bin/powerpc-elf-"

%:
	dh $@ --parallel

override_dh_auto_build-indep: $(stamp)gcc_powerpc-elf
	dh_auto_build

override_dh_auto_clean:
	$(MAKE) clean CROSS_COMPILE=""
	rm -fr $(toolchain_dir)
	rm -f ppc_rom.bin
