linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] m68k: add arch/m68k/Kbuild
@ 2020-05-26 12:38 Masahiro Yamada
  2020-05-26 12:38 ` [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3 Masahiro Yamada
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Masahiro Yamada @ 2020-05-26 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k; +Cc: Masahiro Yamada, linux-kernel

Use the standard obj-y form to specify the sub-directories under
arch/m68k/. No functional change intended.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/m68k/Kbuild   | 19 +++++++++++++++++++
 arch/m68k/Makefile | 20 +-------------------
 2 files changed, 20 insertions(+), 19 deletions(-)
 create mode 100644 arch/m68k/Kbuild

diff --git a/arch/m68k/Kbuild b/arch/m68k/Kbuild
new file mode 100644
index 000000000000..7dc1398dd188
--- /dev/null
+++ b/arch/m68k/Kbuild
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y				+= kernel/ mm/
+obj-$(CONFIG_Q40)		+= q40/
+obj-$(CONFIG_AMIGA)		+= amiga/
+obj-$(CONFIG_ATARI)		+= atari/
+obj-$(CONFIG_MAC)		+= mac/
+obj-$(CONFIG_HP300)		+= hp300/
+obj-$(CONFIG_APOLLO)		+= apollo/
+obj-$(CONFIG_MVME147)		+= mvme147/
+obj-$(CONFIG_MVME16x)		+= mvme16x/
+obj-$(CONFIG_BVME6000)		+= bvme6000/
+obj-$(CONFIG_SUN3X)		+= sun3x/ sun3/
+obj-$(CONFIG_SUN3)		+= sun3/ sun3/prom/
+obj-$(CONFIG_NATFEAT)		+= emu/
+obj-$(CONFIG_M68040)		+= fpsp040/
+obj-$(CONFIG_M68060)		+= ifpsp060/
+obj-$(CONFIG_M68KFPU_EMU)	+= math-emu/
+obj-$(CONFIG_M68000)		+= 68000/
+obj-$(CONFIG_COLDFIRE)		+= coldfire/
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 5d9288384096..88d4d8bbecd6 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -97,27 +97,9 @@ head-$(CONFIG_SUN3)		:= arch/m68k/kernel/sun3-head.o
 head-$(CONFIG_M68000)		:= arch/m68k/68000/head.o
 head-$(CONFIG_COLDFIRE)		:= arch/m68k/coldfire/head.o
 
-core-y				+= arch/m68k/kernel/	arch/m68k/mm/
+core-y				+= arch/m68k/
 libs-y				+= arch/m68k/lib/
 
-core-$(CONFIG_Q40)		+= arch/m68k/q40/
-core-$(CONFIG_AMIGA)		+= arch/m68k/amiga/
-core-$(CONFIG_ATARI)		+= arch/m68k/atari/
-core-$(CONFIG_MAC)		+= arch/m68k/mac/
-core-$(CONFIG_HP300)		+= arch/m68k/hp300/
-core-$(CONFIG_APOLLO)		+= arch/m68k/apollo/
-core-$(CONFIG_MVME147)		+= arch/m68k/mvme147/
-core-$(CONFIG_MVME16x)		+= arch/m68k/mvme16x/
-core-$(CONFIG_BVME6000)		+= arch/m68k/bvme6000/
-core-$(CONFIG_SUN3X)		+= arch/m68k/sun3x/	arch/m68k/sun3/
-core-$(CONFIG_SUN3)		+= arch/m68k/sun3/	arch/m68k/sun3/prom/
-core-$(CONFIG_NATFEAT)		+= arch/m68k/emu/
-core-$(CONFIG_M68040)		+= arch/m68k/fpsp040/
-core-$(CONFIG_M68060)		+= arch/m68k/ifpsp060/
-core-$(CONFIG_M68KFPU_EMU)	+= arch/m68k/math-emu/
-core-$(CONFIG_M68000)		+= arch/m68k/68000/
-core-$(CONFIG_COLDFIRE)		+= arch/m68k/coldfire/
-
 
 all:	zImage
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3
  2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
@ 2020-05-26 12:38 ` Masahiro Yamada
  2020-06-29 17:46   ` Geert Uytterhoeven
  2020-05-26 12:38 ` [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y Masahiro Yamada
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2020-05-26 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k; +Cc: Masahiro Yamada, Sam Creasey, linux-kernel

Move prom/ to the more relevant Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/m68k/Kbuild        | 2 +-
 arch/m68k/sun3/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/Kbuild b/arch/m68k/Kbuild
index 7dc1398dd188..18abb35c26a1 100644
--- a/arch/m68k/Kbuild
+++ b/arch/m68k/Kbuild
@@ -10,7 +10,7 @@ obj-$(CONFIG_MVME147)		+= mvme147/
 obj-$(CONFIG_MVME16x)		+= mvme16x/
 obj-$(CONFIG_BVME6000)		+= bvme6000/
 obj-$(CONFIG_SUN3X)		+= sun3x/ sun3/
-obj-$(CONFIG_SUN3)		+= sun3/ sun3/prom/
+obj-$(CONFIG_SUN3)		+= sun3/
 obj-$(CONFIG_NATFEAT)		+= emu/
 obj-$(CONFIG_M68040)		+= fpsp040/
 obj-$(CONFIG_M68060)		+= ifpsp060/
diff --git a/arch/m68k/sun3/Makefile b/arch/m68k/sun3/Makefile
index 9960c46d303c..4e99e17d82ea 100644
--- a/arch/m68k/sun3/Makefile
+++ b/arch/m68k/sun3/Makefile
@@ -5,4 +5,4 @@
 
 obj-y	:= sun3ints.o sun3dvma.o idprom.o
 
-obj-$(CONFIG_SUN3) += config.o mmu_emu.o leds.o dvma.o intersil.o
+obj-$(CONFIG_SUN3) += config.o mmu_emu.o leds.o dvma.o intersil.o prom/
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y
  2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
  2020-05-26 12:38 ` [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3 Masahiro Yamada
@ 2020-05-26 12:38 ` Masahiro Yamada
  2020-05-27 12:55   ` Greg Ungerer
  2020-06-29 17:47   ` Geert Uytterhoeven
  2020-05-26 12:38 ` [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS Masahiro Yamada
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Masahiro Yamada @ 2020-05-26 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k; +Cc: Masahiro Yamada, linux-kernel

arch/m68k/Makefile computes lots of unneeded cc-option calls.

For example, if CONFIG_M5441x is not defined, there is not point in
evaluating the following compiler flag.

 cpuflags-$(CONFIG_M5441x)      := $(call cc-option,-mcpu=54455,-mcfv4e)

The result is set to cpuflags-, then thrown away.

The right hand side of ':=' is immediately expanded. Hence, all of the
16 calls for cc-option are evaluated. This is expensive since cc-option
invokes the compiler. This occurs even if you are not attempting to
build anything, like 'make ARCH=m68k help'.

Use '=' to expand the value _lazily_. The evaluation for cc-option is
delayed until $(cpuflags-y) is expanded. So, the cc-option test happens
just once at most.

This commit mimics tune-y of arch/arm/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/m68k/Makefile | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 88d4d8bbecd6..ae6e29da3a3e 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -32,30 +32,33 @@ endif
 #	compiler cpu type flag.
 #
 ifndef CONFIG_M68040
-cpuflags-$(CONFIG_M68060)	:= -m68060
+cpuflags-$(CONFIG_M68060)	= -m68060
 endif
 ifndef CONFIG_M68060
-cpuflags-$(CONFIG_M68040)	:= -m68040
+cpuflags-$(CONFIG_M68040)	= -m68040
 endif
-cpuflags-$(CONFIG_M68030)	:=
-cpuflags-$(CONFIG_M68020)	:=
-cpuflags-$(CONFIG_M68000)	:= -m68000
-cpuflags-$(CONFIG_M5441x)	:= $(call cc-option,-mcpu=54455,-mcfv4e)
-cpuflags-$(CONFIG_M54xx)	:= $(call cc-option,-mcpu=5475,-m5200)
-cpuflags-$(CONFIG_M5407)	:= $(call cc-option,-mcpu=5407,-m5200)
-cpuflags-$(CONFIG_M532x)	:= $(call cc-option,-mcpu=532x,-m5307)
-cpuflags-$(CONFIG_M537x)	:= $(call cc-option,-mcpu=537x,-m5307)
-cpuflags-$(CONFIG_M5307)	:= $(call cc-option,-mcpu=5307,-m5200)
-cpuflags-$(CONFIG_M528x)	:= $(call cc-option,-mcpu=528x,-m5307)
-cpuflags-$(CONFIG_M5275)	:= $(call cc-option,-mcpu=5275,-m5307)
-cpuflags-$(CONFIG_M5272)	:= $(call cc-option,-mcpu=5272,-m5307)
-cpuflags-$(CONFIG_M5271)	:= $(call cc-option,-mcpu=5271,-m5307)
-cpuflags-$(CONFIG_M523x)	:= $(call cc-option,-mcpu=523x,-m5307)
-cpuflags-$(CONFIG_M525x)	:= $(call cc-option,-mcpu=5253,-m5200)
-cpuflags-$(CONFIG_M5249)	:= $(call cc-option,-mcpu=5249,-m5200)
-cpuflags-$(CONFIG_M520x)	:= $(call cc-option,-mcpu=5208,-m5200)
-cpuflags-$(CONFIG_M5206e)	:= $(call cc-option,-mcpu=5206e,-m5200)
-cpuflags-$(CONFIG_M5206)	:= $(call cc-option,-mcpu=5206,-m5200)
+cpuflags-$(CONFIG_M68030)	=
+cpuflags-$(CONFIG_M68020)	=
+cpuflags-$(CONFIG_M68000)	= -m68000
+cpuflags-$(CONFIG_M5441x)	= $(call cc-option,-mcpu=54455,-mcfv4e)
+cpuflags-$(CONFIG_M54xx)	= $(call cc-option,-mcpu=5475,-m5200)
+cpuflags-$(CONFIG_M5407)	= $(call cc-option,-mcpu=5407,-m5200)
+cpuflags-$(CONFIG_M532x)	= $(call cc-option,-mcpu=532x,-m5307)
+cpuflags-$(CONFIG_M537x)	= $(call cc-option,-mcpu=537x,-m5307)
+cpuflags-$(CONFIG_M5307)	= $(call cc-option,-mcpu=5307,-m5200)
+cpuflags-$(CONFIG_M528x)	= $(call cc-option,-mcpu=528x,-m5307)
+cpuflags-$(CONFIG_M5275)	= $(call cc-option,-mcpu=5275,-m5307)
+cpuflags-$(CONFIG_M5272)	= $(call cc-option,-mcpu=5272,-m5307)
+cpuflags-$(CONFIG_M5271)	= $(call cc-option,-mcpu=5271,-m5307)
+cpuflags-$(CONFIG_M523x)	= $(call cc-option,-mcpu=523x,-m5307)
+cpuflags-$(CONFIG_M525x)	= $(call cc-option,-mcpu=5253,-m5200)
+cpuflags-$(CONFIG_M5249)	= $(call cc-option,-mcpu=5249,-m5200)
+cpuflags-$(CONFIG_M520x)	= $(call cc-option,-mcpu=5208,-m5200)
+cpuflags-$(CONFIG_M5206e)	= $(call cc-option,-mcpu=5206e,-m5200)
+cpuflags-$(CONFIG_M5206)	= $(call cc-option,-mcpu=5206,-m5200)
+
+# Evaluate tune cc-option calls now
+cpuflags-y := $(cpuflags-y)
 
 KBUILD_AFLAGS += $(cpuflags-y)
 KBUILD_CFLAGS += $(cpuflags-y)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS
  2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
  2020-05-26 12:38 ` [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3 Masahiro Yamada
  2020-05-26 12:38 ` [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y Masahiro Yamada
@ 2020-05-26 12:38 ` Masahiro Yamada
  2020-05-27 13:00   ` Greg Ungerer
  2020-06-29 17:47   ` Geert Uytterhoeven
  2020-05-27 13:04 ` [PATCH 1/4] m68k: add arch/m68k/Kbuild Greg Ungerer
  2020-06-29 17:35 ` Geert Uytterhoeven
  4 siblings, 2 replies; 11+ messages in thread
From: Masahiro Yamada @ 2020-05-26 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k; +Cc: Masahiro Yamada, linux-kernel

Precisely, -D is a preprocessor option.

KBUILD_CPPFLAGS is passed to for compiling .c and .S files too.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/m68k/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index ae6e29da3a3e..c28f9f917ac0 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -70,9 +70,8 @@ ifdef CONFIG_MMU
 KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
 else
 # we can use a m68k-linux-gcc toolchain with these in place
-KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
-KBUILD_CFLAGS += -D__uClinux__
-KBUILD_AFLAGS += -D__uClinux__
+KBUILD_CPPFLAGS += -DUTS_SYSNAME=\"uClinux\"
+KBUILD_CPPFLAGS += -D__uClinux__
 endif
 
 KBUILD_LDFLAGS := -m m68kelf
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y
  2020-05-26 12:38 ` [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y Masahiro Yamada
@ 2020-05-27 12:55   ` Greg Ungerer
  2020-06-29 17:47   ` Geert Uytterhoeven
  1 sibling, 0 replies; 11+ messages in thread
From: Greg Ungerer @ 2020-05-27 12:55 UTC (permalink / raw)
  To: Masahiro Yamada, Geert Uytterhoeven, linux-m68k; +Cc: linux-kernel


On 26/5/20 10:38 pm, Masahiro Yamada wrote:
> arch/m68k/Makefile computes lots of unneeded cc-option calls.
> 
> For example, if CONFIG_M5441x is not defined, there is not point in
> evaluating the following compiler flag.
> 
>   cpuflags-$(CONFIG_M5441x)      := $(call cc-option,-mcpu=54455,-mcfv4e)
> 
> The result is set to cpuflags-, then thrown away.
> 
> The right hand side of ':=' is immediately expanded. Hence, all of the
> 16 calls for cc-option are evaluated. This is expensive since cc-option
> invokes the compiler. This occurs even if you are not attempting to
> build anything, like 'make ARCH=m68k help'.
> 
> Use '=' to expand the value _lazily_. The evaluation for cc-option is
> delayed until $(cpuflags-y) is expanded. So, the cc-option test happens
> just once at most.
> 
> This commit mimics tune-y of arch/arm/Makefile.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg


> ---
> 
>   arch/m68k/Makefile | 45 ++++++++++++++++++++++++---------------------
>   1 file changed, 24 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
> index 88d4d8bbecd6..ae6e29da3a3e 100644
> --- a/arch/m68k/Makefile
> +++ b/arch/m68k/Makefile
> @@ -32,30 +32,33 @@ endif
>   #	compiler cpu type flag.
>   #
>   ifndef CONFIG_M68040
> -cpuflags-$(CONFIG_M68060)	:= -m68060
> +cpuflags-$(CONFIG_M68060)	= -m68060
>   endif
>   ifndef CONFIG_M68060
> -cpuflags-$(CONFIG_M68040)	:= -m68040
> +cpuflags-$(CONFIG_M68040)	= -m68040
>   endif
> -cpuflags-$(CONFIG_M68030)	:=
> -cpuflags-$(CONFIG_M68020)	:=
> -cpuflags-$(CONFIG_M68000)	:= -m68000
> -cpuflags-$(CONFIG_M5441x)	:= $(call cc-option,-mcpu=54455,-mcfv4e)
> -cpuflags-$(CONFIG_M54xx)	:= $(call cc-option,-mcpu=5475,-m5200)
> -cpuflags-$(CONFIG_M5407)	:= $(call cc-option,-mcpu=5407,-m5200)
> -cpuflags-$(CONFIG_M532x)	:= $(call cc-option,-mcpu=532x,-m5307)
> -cpuflags-$(CONFIG_M537x)	:= $(call cc-option,-mcpu=537x,-m5307)
> -cpuflags-$(CONFIG_M5307)	:= $(call cc-option,-mcpu=5307,-m5200)
> -cpuflags-$(CONFIG_M528x)	:= $(call cc-option,-mcpu=528x,-m5307)
> -cpuflags-$(CONFIG_M5275)	:= $(call cc-option,-mcpu=5275,-m5307)
> -cpuflags-$(CONFIG_M5272)	:= $(call cc-option,-mcpu=5272,-m5307)
> -cpuflags-$(CONFIG_M5271)	:= $(call cc-option,-mcpu=5271,-m5307)
> -cpuflags-$(CONFIG_M523x)	:= $(call cc-option,-mcpu=523x,-m5307)
> -cpuflags-$(CONFIG_M525x)	:= $(call cc-option,-mcpu=5253,-m5200)
> -cpuflags-$(CONFIG_M5249)	:= $(call cc-option,-mcpu=5249,-m5200)
> -cpuflags-$(CONFIG_M520x)	:= $(call cc-option,-mcpu=5208,-m5200)
> -cpuflags-$(CONFIG_M5206e)	:= $(call cc-option,-mcpu=5206e,-m5200)
> -cpuflags-$(CONFIG_M5206)	:= $(call cc-option,-mcpu=5206,-m5200)
> +cpuflags-$(CONFIG_M68030)	=
> +cpuflags-$(CONFIG_M68020)	=
> +cpuflags-$(CONFIG_M68000)	= -m68000
> +cpuflags-$(CONFIG_M5441x)	= $(call cc-option,-mcpu=54455,-mcfv4e)
> +cpuflags-$(CONFIG_M54xx)	= $(call cc-option,-mcpu=5475,-m5200)
> +cpuflags-$(CONFIG_M5407)	= $(call cc-option,-mcpu=5407,-m5200)
> +cpuflags-$(CONFIG_M532x)	= $(call cc-option,-mcpu=532x,-m5307)
> +cpuflags-$(CONFIG_M537x)	= $(call cc-option,-mcpu=537x,-m5307)
> +cpuflags-$(CONFIG_M5307)	= $(call cc-option,-mcpu=5307,-m5200)
> +cpuflags-$(CONFIG_M528x)	= $(call cc-option,-mcpu=528x,-m5307)
> +cpuflags-$(CONFIG_M5275)	= $(call cc-option,-mcpu=5275,-m5307)
> +cpuflags-$(CONFIG_M5272)	= $(call cc-option,-mcpu=5272,-m5307)
> +cpuflags-$(CONFIG_M5271)	= $(call cc-option,-mcpu=5271,-m5307)
> +cpuflags-$(CONFIG_M523x)	= $(call cc-option,-mcpu=523x,-m5307)
> +cpuflags-$(CONFIG_M525x)	= $(call cc-option,-mcpu=5253,-m5200)
> +cpuflags-$(CONFIG_M5249)	= $(call cc-option,-mcpu=5249,-m5200)
> +cpuflags-$(CONFIG_M520x)	= $(call cc-option,-mcpu=5208,-m5200)
> +cpuflags-$(CONFIG_M5206e)	= $(call cc-option,-mcpu=5206e,-m5200)
> +cpuflags-$(CONFIG_M5206)	= $(call cc-option,-mcpu=5206,-m5200)
> +
> +# Evaluate tune cc-option calls now
> +cpuflags-y := $(cpuflags-y)
>   
>   KBUILD_AFLAGS += $(cpuflags-y)
>   KBUILD_CFLAGS += $(cpuflags-y)
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS
  2020-05-26 12:38 ` [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS Masahiro Yamada
@ 2020-05-27 13:00   ` Greg Ungerer
  2020-06-29 17:47   ` Geert Uytterhoeven
  1 sibling, 0 replies; 11+ messages in thread
From: Greg Ungerer @ 2020-05-27 13:00 UTC (permalink / raw)
  To: Masahiro Yamada, Geert Uytterhoeven, linux-m68k; +Cc: linux-kernel


On 26/5/20 10:38 pm, Masahiro Yamada wrote:
> Precisely, -D is a preprocessor option.
> 
> KBUILD_CPPFLAGS is passed to for compiling .c and .S files too.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg


> ---
> 
>   arch/m68k/Makefile | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
> index ae6e29da3a3e..c28f9f917ac0 100644
> --- a/arch/m68k/Makefile
> +++ b/arch/m68k/Makefile
> @@ -70,9 +70,8 @@ ifdef CONFIG_MMU
>   KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
>   else
>   # we can use a m68k-linux-gcc toolchain with these in place
> -KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
> -KBUILD_CFLAGS += -D__uClinux__
> -KBUILD_AFLAGS += -D__uClinux__
> +KBUILD_CPPFLAGS += -DUTS_SYSNAME=\"uClinux\"
> +KBUILD_CPPFLAGS += -D__uClinux__
>   endif
>   
>   KBUILD_LDFLAGS := -m m68kelf
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/4] m68k: add arch/m68k/Kbuild
  2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
                   ` (2 preceding siblings ...)
  2020-05-26 12:38 ` [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS Masahiro Yamada
@ 2020-05-27 13:04 ` Greg Ungerer
  2020-06-29 17:35 ` Geert Uytterhoeven
  4 siblings, 0 replies; 11+ messages in thread
From: Greg Ungerer @ 2020-05-27 13:04 UTC (permalink / raw)
  To: Masahiro Yamada, Geert Uytterhoeven, linux-m68k; +Cc: linux-kernel


On 26/5/20 10:38 pm, Masahiro Yamada wrote:
> Use the standard obj-y form to specify the sub-directories under
> arch/m68k/. No functional change intended.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Greg Ungerer <gerg@linux-m68k.org>

Regards
Greg



> ---
> 
>   arch/m68k/Kbuild   | 19 +++++++++++++++++++
>   arch/m68k/Makefile | 20 +-------------------
>   2 files changed, 20 insertions(+), 19 deletions(-)
>   create mode 100644 arch/m68k/Kbuild
> 
> diff --git a/arch/m68k/Kbuild b/arch/m68k/Kbuild
> new file mode 100644
> index 000000000000..7dc1398dd188
> --- /dev/null
> +++ b/arch/m68k/Kbuild
> @@ -0,0 +1,19 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +obj-y				+= kernel/ mm/
> +obj-$(CONFIG_Q40)		+= q40/
> +obj-$(CONFIG_AMIGA)		+= amiga/
> +obj-$(CONFIG_ATARI)		+= atari/
> +obj-$(CONFIG_MAC)		+= mac/
> +obj-$(CONFIG_HP300)		+= hp300/
> +obj-$(CONFIG_APOLLO)		+= apollo/
> +obj-$(CONFIG_MVME147)		+= mvme147/
> +obj-$(CONFIG_MVME16x)		+= mvme16x/
> +obj-$(CONFIG_BVME6000)		+= bvme6000/
> +obj-$(CONFIG_SUN3X)		+= sun3x/ sun3/
> +obj-$(CONFIG_SUN3)		+= sun3/ sun3/prom/
> +obj-$(CONFIG_NATFEAT)		+= emu/
> +obj-$(CONFIG_M68040)		+= fpsp040/
> +obj-$(CONFIG_M68060)		+= ifpsp060/
> +obj-$(CONFIG_M68KFPU_EMU)	+= math-emu/
> +obj-$(CONFIG_M68000)		+= 68000/
> +obj-$(CONFIG_COLDFIRE)		+= coldfire/
> diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
> index 5d9288384096..88d4d8bbecd6 100644
> --- a/arch/m68k/Makefile
> +++ b/arch/m68k/Makefile
> @@ -97,27 +97,9 @@ head-$(CONFIG_SUN3)		:= arch/m68k/kernel/sun3-head.o
>   head-$(CONFIG_M68000)		:= arch/m68k/68000/head.o
>   head-$(CONFIG_COLDFIRE)		:= arch/m68k/coldfire/head.o
>   
> -core-y				+= arch/m68k/kernel/	arch/m68k/mm/
> +core-y				+= arch/m68k/
>   libs-y				+= arch/m68k/lib/
>   
> -core-$(CONFIG_Q40)		+= arch/m68k/q40/
> -core-$(CONFIG_AMIGA)		+= arch/m68k/amiga/
> -core-$(CONFIG_ATARI)		+= arch/m68k/atari/
> -core-$(CONFIG_MAC)		+= arch/m68k/mac/
> -core-$(CONFIG_HP300)		+= arch/m68k/hp300/
> -core-$(CONFIG_APOLLO)		+= arch/m68k/apollo/
> -core-$(CONFIG_MVME147)		+= arch/m68k/mvme147/
> -core-$(CONFIG_MVME16x)		+= arch/m68k/mvme16x/
> -core-$(CONFIG_BVME6000)		+= arch/m68k/bvme6000/
> -core-$(CONFIG_SUN3X)		+= arch/m68k/sun3x/	arch/m68k/sun3/
> -core-$(CONFIG_SUN3)		+= arch/m68k/sun3/	arch/m68k/sun3/prom/
> -core-$(CONFIG_NATFEAT)		+= arch/m68k/emu/
> -core-$(CONFIG_M68040)		+= arch/m68k/fpsp040/
> -core-$(CONFIG_M68060)		+= arch/m68k/ifpsp060/
> -core-$(CONFIG_M68KFPU_EMU)	+= arch/m68k/math-emu/
> -core-$(CONFIG_M68000)		+= arch/m68k/68000/
> -core-$(CONFIG_COLDFIRE)		+= arch/m68k/coldfire/
> -
>   
>   all:	zImage
>   
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/4] m68k: add arch/m68k/Kbuild
  2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
                   ` (3 preceding siblings ...)
  2020-05-27 13:04 ` [PATCH 1/4] m68k: add arch/m68k/Kbuild Greg Ungerer
@ 2020-06-29 17:35 ` Geert Uytterhoeven
  4 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-06-29 17:35 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-m68k, Linux Kernel Mailing List

On Tue, May 26, 2020 at 2:38 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> Use the standard obj-y form to specify the sub-directories under
> arch/m68k/. No functional change intended.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3
  2020-05-26 12:38 ` [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3 Masahiro Yamada
@ 2020-06-29 17:46   ` Geert Uytterhoeven
  0 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-06-29 17:46 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-m68k, Sam Creasey, Linux Kernel Mailing List

On Tue, May 26, 2020 at 2:38 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> Move prom/ to the more relevant Makefile.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y
  2020-05-26 12:38 ` [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y Masahiro Yamada
  2020-05-27 12:55   ` Greg Ungerer
@ 2020-06-29 17:47   ` Geert Uytterhoeven
  1 sibling, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-06-29 17:47 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-m68k, Linux Kernel Mailing List

On Tue, May 26, 2020 at 2:38 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> arch/m68k/Makefile computes lots of unneeded cc-option calls.
>
> For example, if CONFIG_M5441x is not defined, there is not point in
> evaluating the following compiler flag.
>
>  cpuflags-$(CONFIG_M5441x)      := $(call cc-option,-mcpu=54455,-mcfv4e)
>
> The result is set to cpuflags-, then thrown away.
>
> The right hand side of ':=' is immediately expanded. Hence, all of the
> 16 calls for cc-option are evaluated. This is expensive since cc-option
> invokes the compiler. This occurs even if you are not attempting to
> build anything, like 'make ARCH=m68k help'.
>
> Use '=' to expand the value _lazily_. The evaluation for cc-option is
> delayed until $(cpuflags-y) is expanded. So, the cc-option test happens
> just once at most.
>
> This commit mimics tune-y of arch/arm/Makefile.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS
  2020-05-26 12:38 ` [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS Masahiro Yamada
  2020-05-27 13:00   ` Greg Ungerer
@ 2020-06-29 17:47   ` Geert Uytterhoeven
  1 sibling, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-06-29 17:47 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-m68k, Linux Kernel Mailing List

On Tue, May 26, 2020 at 2:38 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> Precisely, -D is a preprocessor option.
>
> KBUILD_CPPFLAGS is passed to for compiling .c and .S files too.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v5.9 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-06-29 19:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 12:38 [PATCH 1/4] m68k: add arch/m68k/Kbuild Masahiro Yamada
2020-05-26 12:38 ` [PATCH 2/4] m68k: descend to prom from arch/m68k/sun3 Masahiro Yamada
2020-06-29 17:46   ` Geert Uytterhoeven
2020-05-26 12:38 ` [PATCH 3/4] m68k: optimize cc-option calls for cpuflags-y Masahiro Yamada
2020-05-27 12:55   ` Greg Ungerer
2020-06-29 17:47   ` Geert Uytterhoeven
2020-05-26 12:38 ` [PATCH 4/4] m68k: pass -D options to KBUILD_CPPFLAGS instead of KBUILD_{A,C}FLAGS Masahiro Yamada
2020-05-27 13:00   ` Greg Ungerer
2020-06-29 17:47   ` Geert Uytterhoeven
2020-05-27 13:04 ` [PATCH 1/4] m68k: add arch/m68k/Kbuild Greg Ungerer
2020-06-29 17:35 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).