diff --git a/litecross/Makefile b/litecross/Makefile index 371affb..46584fd 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -206,7 +206,7 @@ ifneq ($(LINUX_SRCDIR),) TARGET_ARCH = $(firstword $(subst -, ,$(TARGET))) TARGET_ARCH_MANGLED = $(patsubst i%86,x86,$(patsubst aarch64%,arm64%,$(TARGET_ARCH))) LINUX_ARCH_LIST = $(sort $(notdir $(wildcard $(LINUX_SRCDIR)/arch/*))) -LINUX_ARCH = $(firstword $(foreach a,$(LINUX_ARCH_LIST),$(findstring $(a),$(TARGET_ARCH_MANGLED)))) +LINUX_ARCH = $(lastword $(foreach a,$(LINUX_ARCH_LIST),$(if $(filter $(a)%,$(TARGET_ARCH_MANGLED)),$(a)))) ifneq ($(LINUX_ARCH),) all: kernel-headers install: install-kernel-headers