#!/usr/bin/make -f
export DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include debian/cross-toolchain.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=-all
export DEB_CFLAGS_MAINT_APPEND=-Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types

%:
	dh $@ --buildsystem=makefile --sourcedirectory=openbios

override_dh_auto_build: $(stamp)gcc_mipsel-none-elf
	dh_auto_build --sourcedirectory=shell -- PREFIX=$(CURDIR)/cross-toolchain/bin/mipsel-none-elf
	dh_auto_build -- PREFIX=$(CURDIR)/cross-toolchain/bin/mipsel-none-elf
	chmod 644 openbios/openbios.bin

override_dh_auto_clean:
	dh_auto_clean --sourcedirectory=shell
	dh_auto_clean
