#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/architecture.mk

%:
	dh $@

# gnu-efi ships the linker script, crt0 and static libraries under
# the multiarch directory.
override_dh_auto_configure:
	dh_auto_configure -- \
		-Defi-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		-Defi-ldsdir=/usr/lib/$(DEB_HOST_MULTIARCH)

# Silence blhc warnings for the EFI binaries as they can't be hardened.
override_dh_auto_build:
	@echo 'blhc: ignore-line-regexp: .* -o efi/ukiboot\.so .*'
	@echo 'blhc: ignore-line-regexp: .* -c \.\./efi/.*'
	dh_auto_build
