kbuild: require all architectures to have arch/$(SRCARCH)/Kbuild
Subsystems (20)
PATCH 1/5 kbuild: require all architectures to have arch/$(SRCARCH)/Kbuild
arch/$(SRCARCH)/Kbuild is useful for Makefile cleanups because you can use the obj-y syntax.
Add an empty file if it is missing in arch/$(SRCARCH)/.
---
Makefile | 2 +- arch/alpha/Kbuild | 1 + arch/arc/Makefile | 3 --- arch/arm/Makefile | 1 - arch/arm64/Makefile | 1 - arch/csky/Kbuild | 1 + arch/h8300/Kbuild | 1 + arch/hexagon/Kbuild | 1 + arch/ia64/Kbuild | 1 + arch/microblaze/Kbuild | 1 + arch/mips/Makefile | 3 --- arch/nds32/Kbuild | 1 + arch/nios2/Kbuild | 1 + arch/openrisc/Makefile | 1 - arch/parisc/Kbuild | 1 + arch/powerpc/Makefile | 3 --- arch/riscv/Makefile | 1 - arch/s390/Makefile | 3 --- arch/sh/Kbuild | 1 + arch/sparc/Makefile | 3 --- arch/um/Kbuild | 1 + arch/x86/Makefile | 3 --- arch/xtensa/Kbuild | 1 + 23 files changed, 13 insertions(+), 23 deletions(-) create mode 100644 arch/alpha/Kbuild create mode 100644 arch/csky/Kbuild create mode 100644 arch/h8300/Kbuild create mode 100644 arch/hexagon/Kbuild create mode 100644 arch/ia64/Kbuild create mode 100644 arch/microblaze/Kbuild create mode 100644 arch/nds32/Kbuild create mode 100644 arch/nios2/Kbuild create mode 100644 arch/parisc/Kbuild create mode 100644 arch/sh/Kbuild create mode 100644 arch/um/Kbuild create mode 100644 arch/xtensa/Kbuild
Makefile +1 -1
@@ -658,7 +658,7 @@ endif ifeq ($(KBUILD_EXTMOD),) # Objects we will link into vmlinux / subdirs we need to visit -core-y := init/ usr/ +core-y := init/ usr/ arch/$(SRCARCH)/ drivers-y := drivers/ sound/ drivers-$(CONFIG_SAMPLES) += samples/ drivers-$(CONFIG_NET) += net/
arch/alpha/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/arc/Makefile +0 -3
@@ -85,9 +85,6 @@ KBUILD_LDFLAGS += $(ldflags-y) head-y := arch/arc/kernel/head.o -# See arch/arc/Kbuild for content of core part of the kernel -core-y += arch/arc/ - # w/o this dtb won't embed into kernel binary core-y += arch/arc/boot/dts/
arch/arm/Makefile +0 -1
@@ -252,7 +252,6 @@ endif export TEXT_OFFSET GZFLAGS MMUEXT -core-y += arch/arm/ # If we have a machine-specific directory, then include it in the build. core-y += $(machdirs) $(platdirs)
arch/arm64/Makefile +0 -1
@@ -149,7 +149,6 @@ KBUILD_CFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) KBUILD_CPPFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) KBUILD_AFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) -core-y += arch/arm64/ libs-y := arch/arm64/lib/ $(libs-y) libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
arch/csky/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/h8300/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/hexagon/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/ia64/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/microblaze/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/mips/Makefile +0 -3
@@ -332,9 +332,6 @@ head-y := arch/mips/kernel/head.o libs-y += arch/mips/lib/ libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/ -# See arch/mips/Kbuild for content of core part of the kernel -core-y += arch/mips/ - drivers-y += arch/mips/crypto/ # suspend and hibernation support
arch/nds32/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/nios2/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/openrisc/Makefile +0 -1
@@ -42,7 +42,6 @@ endif head-y := arch/openrisc/kernel/head.o -core-y += arch/openrisc/ libs-y += $(LIBGCC) PHONY += vmlinux.bin
arch/parisc/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/powerpc/Makefile +0 -3
@@ -267,9 +267,6 @@ head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o -# See arch/powerpc/Kbuild for content of core part of the kernel -core-y += arch/powerpc/ - # Default to zImage, override when needed all: zImage
arch/riscv/Makefile +0 -1
@@ -90,7 +90,6 @@ endif head-y := arch/riscv/kernel/head.o -core-y += arch/riscv/ core-$(CONFIG_RISCV_ERRATA_ALTERNATIVE) += arch/riscv/errata/ libs-y += arch/riscv/lib/
arch/s390/Makefile +0 -3
@@ -128,9 +128,6 @@ OBJCOPYFLAGS := -O binary head-y := arch/s390/kernel/head64.o -# See arch/s390/Kbuild for content of core part of the kernel -core-y += arch/s390/ - libs-y += arch/s390/lib/ drivers-y += drivers/s390/
arch/sh/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/sparc/Makefile +0 -3
@@ -58,9 +58,6 @@ endif head-y := arch/sparc/kernel/head_$(BITS).o -# See arch/sparc/Kbuild for the core part of the kernel -core-y += arch/sparc/ - libs-y += arch/sparc/prom/ libs-y += arch/sparc/lib/
arch/um/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
arch/x86/Makefile +0 -3
@@ -239,9 +239,6 @@ head-y += arch/x86/kernel/platform-quirks.o libs-y += arch/x86/lib/ -# See arch/x86/Kbuild for content of core part of the kernel -core-y += arch/x86/ - # drivers-y are linked after core-y drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/ drivers-$(CONFIG_PCI) += arch/x86/pci/
arch/xtensa/Kbuild new file +1 -0
@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only
Signature · 1 line
2.27.0
PATCH 2/5 alpha: move core-y in arch/alpha/Makefile to arch/alpha/Kbuild
Use obj-y to clean up Makefile.
---
arch/alpha/Kbuild | 2 ++ arch/alpha/Makefile | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/alpha/Kbuild +2 -0
@@ -1 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-y += kernel/ mm/ +obj-$(CONFIG_MATHEMU) += math-emu/
arch/alpha/Makefile +0 -2
@@ -38,8 +38,6 @@ KBUILD_CFLAGS += $(cflags-y) -Wa,-mev6 head-y := arch/alpha/kernel/head.o -core-y += arch/alpha/kernel/ arch/alpha/mm/ -core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/ libs-y += arch/alpha/lib/ # export what is needed by arch/alpha/boot/Makefile
Signature · 1 line
2.27.0
PATCH 4/5 hexagon: move core-y in arch/hexagon/Makefile to arch/hexagon/Kbuild
In reply to Masahiro YamadaUse obj-y to clean up Makefile.
---
arch/hexagon/Kbuild | 1 + arch/hexagon/Makefile | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-)
arch/hexagon/Kbuild +1 -0
@@ -1 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only +obj += kernel/ mm/ lib/
arch/hexagon/Makefile +0 -4
@@ -34,7 +34,3 @@ KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__ KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME) head-y := arch/hexagon/kernel/head.o - -core-y += arch/hexagon/kernel/ \ - arch/hexagon/mm/ \ - arch/hexagon/lib/
Signature · 1 line
2.27.0
PATCH 3/5 h8300: move core-y in arch/h8300/Makefile to arch/h8300/Kbuild
In reply to Masahiro YamadaUse obj-y to clean up Makefile.
---
arch/h8300/Kbuild | 1 + arch/h8300/Makefile | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-)
arch/h8300/Kbuild +1 -0
@@ -1 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-y += kernel/ mm/ boot/dts/
arch/h8300/Makefile +0 -3
@@ -30,9 +30,6 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := $(call cc-cross-prefix, h8300-unknown-linux- h8300-linux-) endif -core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ -core-y += arch/$(ARCH)/boot/dts/ - libs-y += arch/$(ARCH)/lib/ boot := arch/h8300/boot
Signature · 1 line
2.27.0
PATCH 5/5 sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild
In reply to Masahiro YamadaUse obj-y to clean up Makefile.
---
arch/sh/Kbuild | 3 +++ arch/sh/Makefile | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-)
arch/sh/Kbuild +3 -0
@@ -1 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-y += kernel/ mm/ boards/ +obj-$(CONFIG_SH_FPU_EMU) += math-emu/ +obj-$(CONFIG_USE_BUILTIN_DTB) += boot/dts/
arch/sh/Makefile +0 -5
@@ -116,11 +116,6 @@ export ld-bfd head-y := arch/sh/kernel/head_32.o -core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ -core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ - -core-$(CONFIG_USE_BUILTIN_DTB) += arch/sh/boot/dts/ - # Mach groups machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx
Signature · 1 line
2.27.0
Re: [PATCH 4/5] hexagon: move core-y in arch/hexagon/Makefile to arch/hexagon/Kbuild
In reply to Masahiro YamadaHi Masahiro,
Quoted 14 lines · Masahiro Yamada
Use obj-y to clean up
Makefile.Signed-off-by Masahiro Yamada <[email protected]>---
arch/hexagon/Kbuild | 1 + arch/hexagon/Makefile | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-)arch/hexagon/Kbuild +0
-0
arch/hexagon/Kbuild line 2
Quoted 2 lines
arch/hexagon/Kbuild +1
-0@@ -1 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only +obj += kernel/ mm/ lib/
This should probably be 'obj-y' instead of 'obj'?
Kind regards,
Nicolas
Re: [PATCH 4/5] hexagon: move core-y in arch/hexagon/Makefile to arch/hexagon/Kbuild
Quoted 13 lines · Nicolas Schier
Hi Masahiro,
Quoted 9 lines · Masahiro Yamada
Use obj-y to clean up
Makefile.Signed-off-by Masahiro Yamada <[email protected]>---
arch/hexagon/Kbuild | 1 + arch/hexagon/Makefile | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-)
Quoted 10 lines
arch/hexagon/Kbuild line 2
Quoted 7 lines
arch/hexagon/Kbuild +1
-0@@ -1 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only +obj += kernel/ mm/ lib/This should probably be 'obj-y' instead of 'obj'?
Oops, thanks for catching that!
I will fix it when I apply it.
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 8 lines · Masahiro Yamada
arch/$(SRCARCH)/Kbuild is useful for
Makefilecleanups because you can use the obj-y syntax.Add an empty file if it is missing in arch/$(SRCARCH)/.
Signed-off-by Masahiro Yamada <[email protected]>---
Applied to linux-kbuild.
Quoted 270 lines
Makefile | 2 +- arch/alpha/Kbuild | 1 + arch/arc/Makefile | 3 --- arch/arm/Makefile | 1 - arch/arm64/Makefile | 1 - arch/csky/Kbuild | 1 + arch/h8300/Kbuild | 1 + arch/hexagon/Kbuild | 1 + arch/ia64/Kbuild | 1 + arch/microblaze/Kbuild | 1 + arch/mips/Makefile | 3 --- arch/nds32/Kbuild | 1 + arch/nios2/Kbuild | 1 + arch/openrisc/Makefile | 1 - arch/parisc/Kbuild | 1 + arch/powerpc/Makefile | 3 --- arch/riscv/Makefile | 1 - arch/s390/Makefile | 3 --- arch/sh/Kbuild | 1 + arch/sparc/Makefile | 3 --- arch/um/Kbuild | 1 + arch/x86/Makefile | 3 --- arch/xtensa/Kbuild | 1 + 23 files changed, 13 insertions(+), 23 deletions(-) create mode 100644 arch/alpha/Kbuild create mode 100644 arch/csky/Kbuild create mode 100644 arch/h8300/Kbuild create mode 100644 arch/hexagon/Kbuild create mode 100644 arch/ia64/Kbuild create mode 100644 arch/microblaze/Kbuild create mode 100644 arch/nds32/Kbuild create mode 100644 arch/nios2/Kbuild create mode 100644 arch/parisc/Kbuild create mode 100644 arch/sh/Kbuild create mode 100644 arch/um/Kbuild create mode 100644 arch/xtensa/KbuildMakefile +1
-1@@ -658,7 +658,7 @@ endif ifeq ($(KBUILD_EXTMOD),) # Objects we will link into vmlinux / subdirs we need to visit -core-y := init/ usr/ +core-y := init/ usr/ arch/$(SRCARCH)/ drivers-y := drivers/ sound/ drivers-$(CONFIG_SAMPLES) += samples/ drivers-$(CONFIG_NET) += net/arch/alpha/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/arc/Makefile +0
-3@@ -85,9 +85,6 @@ KBUILD_LDFLAGS += $(ldflags-y) head-y := arch/arc/kernel/head.o -# See arch/arc/Kbuild for content of core part of the kernel -core-y += arch/arc/ - # w/o this dtb won't embed into kernel binary core-y += arch/arc/boot/dts/arch/arm/Makefile +0
-1@@ -252,7 +252,6 @@ endif export TEXT_OFFSET GZFLAGS MMUEXT -core-y += arch/arm/ # If we have a machine-specific directory, then include it in the build. core-y += $(machdirs) $(platdirs)arch/arm64/Makefile +0
-1@@ -149,7 +149,6 @@ KBUILD_CFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) KBUILD_CPPFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) KBUILD_AFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) -core-y += arch/arm64/ libs-y := arch/arm64/lib/ $(libs-y) libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.aarch/csky/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/h8300/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/hexagon/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/ia64/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/microblaze/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/mips/Makefile +0
-3@@ -332,9 +332,6 @@ head-y := arch/mips/kernel/head.o libs-y += arch/mips/lib/ libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/ -# See arch/mips/Kbuild for content of core part of the kernel -core-y += arch/mips/ - drivers-y += arch/mips/crypto/ # suspend and hibernation supportarch/nds32/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/nios2/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/openrisc/Makefile +0
-1@@ -42,7 +42,6 @@ endif head-y := arch/openrisc/kernel/head.o -core-y += arch/openrisc/ libs-y += $(LIBGCC) PHONY += vmlinux.binarch/parisc/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/powerpc/Makefile +0
-3@@ -267,9 +267,6 @@ head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o -# See arch/powerpc/Kbuild for content of core part of the kernel -core-y += arch/powerpc/ - # Default to zImage, override when needed all: zImagearch/riscv/Makefile +0
-1@@ -90,7 +90,6 @@ endif head-y := arch/riscv/kernel/head.o -core-y += arch/riscv/ core-$(CONFIG_RISCV_ERRATA_ALTERNATIVE) += arch/riscv/errata/ libs-y += arch/riscv/lib/arch/s390/Makefile +0
-3@@ -128,9 +128,6 @@ OBJCOPYFLAGS := -O binary head-y := arch/s390/kernel/head64.o -# See arch/s390/Kbuild for content of core part of the kernel -core-y += arch/s390/ - libs-y += arch/s390/lib/ drivers-y += drivers/s390/arch/sh/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/sparc/Makefile +0
-3@@ -58,9 +58,6 @@ endif head-y := arch/sparc/kernel/head_$(BITS).o -# See arch/sparc/Kbuild for the core part of the kernel -core-y += arch/sparc/ - libs-y += arch/sparc/prom/ libs-y += arch/sparc/lib/arch/um/Kbuild new file +1
-0@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-onlyarch/x86/Makefile +0
-3@@ -239,9 +239,6 @@ head-y += arch/x86/kernel/platform-quirks.o libs-y += arch/x86/lib/ -# See arch/x86/Kbuild for content of core part of the kernel -core-y += arch/x86/ - # drivers-y are linked after core-y drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/ drivers-$(CONFIG_PCI) += arch/x86/pci/arch/xtensa/Kbuild new file +1
-1@@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only --2.27.0
Signature · 2 lines
Best Regards Masahiro Yamada