litecross: automatically determine LINUX_ARCH for kernel headers

This commit is contained in:
Rich Felker 2016-05-14 05:23:25 +00:00
parent 9bd379f80b
commit 5faef372d4
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,10 @@ install-toolchain: | obj_toolchain/.lc_built
ln -sf $(TARGET)-gcc $(DESTDIR)$(OUTPUT)/bin/$(TARGET)-cc ln -sf $(TARGET)-gcc $(DESTDIR)$(OUTPUT)/bin/$(TARGET)-cc
ifneq ($(LINUX_SRCDIR),) 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),) ifneq ($(LINUX_ARCH),)
all: kernel-headers all: kernel-headers
install: install-kernel-headers install: install-kernel-headers