#!/usr/bin/make -f export DH_VERBOSE := 1 include /usr/share/dpkg/architecture.mk ifeq (amd64, $(DEB_HOST_ARCH_CPU)) ARCH := x86_64 EFI_ARCH := x64 else ifeq (i386, $(DEB_HOST_ARCH_CPU)) ARCH := ia32 EFI_ARCH := ia32 else ifeq (arm64, $(DEB_HOST_ARCH_CPU)) ARCH = aarch64 EFI_ARCH := aa64 # https://sourceforge.net/p/refind/code/ci/14ecfde106fe3d5b3ead5e02bf56d340770be5ff/tree/BUILDING.txt#l411 GNU_EFI_EXTRA_MAKEOPTS := $(shell dpkg --compare-versions "$$(dpkg-query -f '$${Version}' -W gnu-efi)" '>=' '3.0.17~' && echo GNUEFI_ARM64_TARGET_SUPPORT=y) else $(warning EFI architecture for $(DEB_HOST_ARCH_CPU) is unknown) ARCH := $(DEB_HOST_ARCH_CPU) EFI_ARCH := $(DEB_HOST_ARCH_CPU) endif endif endif %: dh $@ override_dh_auto_clean: dh_auto_clean rm -rf drivers_*/ override_dh_auto_build: dh_auto_build -- gnuefi 'ARCH=$(ARCH)' $(GNU_EFI_EXTRA_MAKEOPTS) dh_auto_build -- fs_gnuefi 'ARCH=$(ARCH)' $(GNU_EFI_EXTRA_MAKEOPTS) override_dh_auto_install: # "make install" actually runs "efi-install" for the current system, so let's not do that :) override_dh_install: dh_install mkdir -p debian/refind/usr/share/refind/refind/tools_$(EFI_ARCH) cp gptsync/gptsync_$(EFI_ARCH).efi debian/refind/usr/share/refind/refind/tools_$(EFI_ARCH)/ override_dh_installchangelogs: dh_installchangelogs NEWS.txt