diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-04-25 03:59:23 +0900 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-04-27 21:16:59 +0200 |
commit | 1616d46052efae72587fb6da5f4fd117f91ce6f8 (patch) | |
tree | e95c9db97d390a7ccd8b616c8ed1d65066dff066 /Makefile | |
parent | 6ad4f5fe1b225eaa0f7e42839a6ee98fa15ff925 (diff) | |
download | barebox-1616d46052efae72587fb6da5f4fd117f91ce6f8.tar.gz barebox-1616d46052efae72587fb6da5f4fd117f91ce6f8.tar.xz |
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 <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -307,8 +307,8 @@ export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_ve # Needed to be compatible with the O= option LINUXINCLUDE := -Iinclude -I$(srctree)/dts/include \ $(if $(KBUILD_SRC), -I$(srctree)/include) \ - -I$(srctree)/arch/$(ARCH)/include \ - -I$(objtree)/arch/$(ARCH)/include \ + -I$(srctree)/arch/$(SRCARCH)/include \ + -I$(objtree)/arch/$(SRCARCH)/include \ -include $(srctree)/include/linux/kconfig.h KBUILD_CPPFLAGS := -D__KERNEL__ -D__BAREBOX__ $(LINUXINCLUDE) -fno-builtin -ffreestanding @@ -424,7 +424,7 @@ ifeq ($(config-targets),1) # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. # KBUILD_DEFCONFIG may point out an alternative default configuration # used for 'make defconfig' -include $(srctree)/arch/$(ARCH)/Makefile +include $(srctree)/arch/$(SRCARCH)/Makefile export KBUILD_DEFCONFIG config: scripts_basic outputmakefile FORCE @@ -452,7 +452,7 @@ endif # Objects we will link into barebox / subdirs we need to visit common-y := common/ drivers/ commands/ lib/ crypto/ net/ fs/ firmware/ -include $(srctree)/arch/$(ARCH)/Makefile +include $(srctree)/arch/$(SRCARCH)/Makefile ifeq ($(dot-config),1) # Read in dependencies to all Kconfig* files, make sure to run syncconfig if @@ -520,7 +520,7 @@ export KBUILD_IMAGE ?= barebox.bin export KBUILD_BINARY ?= barebox.bin # KBUILD_IMAGE and _BINARY may be overruled on the command line or # set in the environment. -# Also any assignments in arch/$(ARCH)/Makefile take precedence over +# Also any assignments in arch/$(SRCARCH)/Makefile take precedence over # the default value. barebox-flash-image: $(KBUILD_IMAGE) FORCE @@ -574,7 +574,7 @@ export DEFAULT_COMPRESSION_SUFFIX # --------------------------------------------------------------------------- # barebox is built from the objects selected by $(barebox-init) and # $(barebox-main). Most are built-in.o files from top-level directories -# in the kernel tree, others are specified in arch/$(ARCH)Makefile. +# in the kernel tree, others are specified in arch/$(SRCARCH)/Makefile. # Ordering when linking is important, and $(barebox-init) must be first. # # FIXME: This picture is wrong for barebox. We have no init, driver, mm @@ -601,7 +601,7 @@ export BAREBOX_PBL_OBJS := $(pbl-common-y) BAREBOX_LDS := $(lds-y) # Rule to link barebox -# May be overridden by arch/$(ARCH)/Makefile +# May be overridden by arch/$(SRCARCH)/Makefile quiet_cmd_barebox__ ?= LD $@ cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \ -T $(BAREBOX_LDS) \ @@ -742,7 +742,7 @@ UIMAGE_BASE ?= $(shell printf "0x%08x" $$(($(CONFIG_TEXT_BASE) - 0x200000))) # For development provide a target which makes barebox loadable by an # unmodified u-boot quiet_cmd_barebox_mkimage = MKIMAGE $@ - cmd_barebox_mkimage = $(srctree)/scripts/mkimage -A $(ARCH) -T firmware -C none \ + cmd_barebox_mkimage = $(srctree)/scripts/mkimage -A $(SRCARCH) -T firmware -C none \ -O barebox -a $(UIMAGE_BASE) -e $(UIMAGE_BASE) \ -n "barebox $(KERNELRELEASE)" -d $< $@ @@ -851,9 +851,9 @@ prepare0: archprepare FORCE prepare prepare-all: prepare0 # Leave this as default for preprocessing barebox.lds.S, which is now -# done in arch/$(ARCH)/kernel/Makefile +# done in arch/$(SRCARCH)/kernel/Makefile -export CPPFLAGS_barebox.lds += -C -U$(ARCH) +export CPPFLAGS_barebox.lds += -C -U$(SRCARCH) define symlink-config-h if [ -f $(srctree)/$(BOARD)/config.h ]; then \ @@ -1052,7 +1052,7 @@ rpm: include/config/kernel.release FORCE # Brief documentation of the typical targets used # --------------------------------------------------------------------------- -boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) +boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig) boards := $(sort $(notdir $(boards))) help: @@ -1080,9 +1080,9 @@ help: @echo ' checkstack - Generate a list of stack hogs' @echo ' namespacecheck - Name space analysis on compiled kernel' @echo '' - @echo 'Architecture specific targets ($(ARCH)):' + @echo 'Architecture specific targets ($(SRCARCH)):' @$(if $(archhelp),$(archhelp),\ - echo ' No architecture specific help defined for $(ARCH)') + echo ' No architecture specific help defined for $(SRCARCH)') @echo '' @$(if $(boards), \ $(foreach b, $(boards), \ |