From 1616d46052efae72587fb6da5f4fd117f91ce6f8 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 25 Apr 2020 03:59:23 +0900 Subject: kbuild: use $(SRCARCH) to point to the arch directory A couple of arch directories in Linux are biarch, that is, a single arch/*/ directory supports both 32-bit and 64-bit. In old days of Linux, they started as separated directories. arm/arm64 is the exceptional case, but the other architectures were unified. e.g.) arch/i386, arch/x86_64 -> arch/x86 arch/sh, arch/sh64 -> arch/sh arch/sparc, arch/sparc64 -> arch/sparc Linux commit 6752ed90da03 ("Kbuild: allow arch/xxx to use a different source path") introduced SRCARCH to point to the arch directory, still allowing to pass in the former ARCH=i386 or ARCH=x86_64. The top Makefile in Linux converts ARCH to SRCARCH as follows: # Additional ARCH settings for x86 ifeq ($(ARCH),i386) SRCARCH := x86 endif ifeq ($(ARCH),x86_64) SRCARCH := x86 endif So, if you follow the upstream Kbuild convention, using arch/$(SRCARCH) is the correct way to point to the arch directory. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- images/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'images/Makefile') diff --git a/images/Makefile b/images/Makefile index fe29c75e27..0aa4676aea 100644 --- a/images/Makefile +++ b/images/Makefile @@ -50,7 +50,7 @@ quiet_cmd_objcopy_bin = OBJCOPYB $@ pbl-lds := $(obj)/pbl.lds extra-y += $(pbl-lds) -$(pbl-lds): $(obj)/../arch/$(ARCH)/lib/pbl.lds.S FORCE +$(pbl-lds): $(obj)/../arch/$(SRCARCH)/lib/pbl.lds.S FORCE $(call if_changed_dep,cpp_lds_S) quiet_cmd_elf__ ?= LD $@ @@ -139,8 +139,8 @@ $(obj)/%.img: $(obj)/$$(FILE_$$(@F)) $(Q)if [ -z $(FILE_$(@F)) ]; then echo "FILE_$(@F) empty!"; false; fi $(call if_changed,shipped) -board = $(srctree)/arch/$(ARCH)/boards -objboard = $(objtree)/arch/$(ARCH)/boards +board = $(srctree)/arch/$(SRCARCH)/boards +objboard = $(objtree)/arch/$(SRCARCH)/boards include $(srctree)/images/Makefile.am33xx include $(srctree)/images/Makefile.am35xx -- cgit v1.2.3