diff --git a/litecross/Makefile b/litecross/Makefile index 316a8ed..485eae1 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -157,6 +157,10 @@ install-toolchain: | obj_toolchain/.lc_built ln -sf $(TARGET)-gcc $(DESTDIR)$(OUTPUT)/bin/$(TARGET)-cc 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)))) ifneq ($(LINUX_ARCH),) all: kernel-headers install: install-kernel-headers