m68k: merge the mmu and non-mmu kernel/Makefiles
PATCH 1/1 m68k: merge the mmu and non-mmu kernel/Makefiles
From: Greg Ungerer <[email protected]>
[This is a resend of this patch. If no-one has any objections then I want to push this into linux-next, for eventual inclusion in the 3.2 merge window.]
The few differences between the mmu and non-mmu kernel/Makefiles can easily be handled inside of a single Makefile. Merge the 2 back into a single Makefile.
--- arch/m68k/kernel/Makefile | 23 +++++++++++++++++++---- arch/m68k/kernel/Makefile_mm | 17 ----------------- arch/m68k/kernel/Makefile_no | 10 ---------- 3 files changed, 19 insertions(+), 31 deletions(-) delete mode 100644 arch/m68k/kernel/Makefile_mm delete mode 100644 arch/m68k/kernel/Makefile_no
arch/m68k/kernel/Makefile +19 -4
@@ -1,5 +1,20 @@ -ifdef CONFIG_MMU -include arch/m68k/kernel/Makefile_mm -else -include arch/m68k/kernel/Makefile_no +# +# Makefile for the linux kernel. +# + +extra-$(CONFIG_MMU) := head.o +extra-$(CONFIG_SUN3) := sun3-head.o +extra-y += vmlinux.lds + +obj-y := entry.o m68k_ksyms.o process.o ptrace.o setup.o signal.o \ + sys_m68k.o syscalltable.o time.o traps.o + +obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo +obj-$(CONFIG_MMU) += ints.o module.o devres.o +devres-$(CONFIG_MMU) = ../../../kernel/irq/devres.o + +ifndef CONFIG_MMU +obj-y += init_task.o irq.o +obj-$(CONFIG_MODULES) += module.o endif +
arch/m68k/kernel/Makefile_mm deleted +0 -17
@@ -1,17 +0,0 @@ -# -# Makefile for the linux kernel. -# - -ifndef CONFIG_SUN3 - extra-y := head.o -else - extra-y := sun3-head.o -endif -extra-y += vmlinux.lds - -obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \ - sys_m68k.o time.o setup.o m68k_ksyms.o devres.o syscalltable.o - -devres-y = ../../../kernel/irq/devres.o - -obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
arch/m68k/kernel/Makefile_no deleted +0 -10
@@ -1,10 +0,0 @@ -# -# Makefile for arch/m68knommu/kernel. -# - -extra-y := vmlinux.lds - -obj-y += dma.o entry.o init_task.o irq.o m68k_ksyms.o process.o ptrace.o \ - setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o - -obj-$(CONFIG_MODULES) += module.o
Signature · 1 line
1.7.0.4
Quoted 9 lines · On Thu, Aug 11, 2011 at 02:47:24PM +1000, [email protected] wrote:
From: Greg Ungerer <[email protected]>
[This is a resend of this patch. If no-one has any objections then I want to push this into linux-next, for eventual inclusion in the 3.2 merge window.]
The few differences between the mmu and non-mmu kernel/Makefiles can easily be handled inside of a single
Makefile. Merge the 2 back into a singleMakefile.
Looks good (except the typo that is nto a typo:-) )
Quoted 7 lines · Sam Ravnborg
Quoted 6 lines · On Thu, Aug 11, 2011 at 02:47:24PM +1000, [email protected] wrote:
From: Greg Ungerer<[email protected]>
[This is a resend of this patch. If no-one has any objections then I want to push this into linux-next, for eventual inclusion in the 3.2 merge window.]
Quoted 5 lines
Quoted 3 lines
The few differences between the mmu and non-mmu kernel/Makefiles can easily be handled inside of a single
Makefile. Merge the 2 back into a singleMakefile.Looks good (except the typo that is nto a typo:-) )
That is a little gem that one :-)
Quoted 1 line
Acked-by Sam Ravnborg<[email protected]>
Thanks Sam!
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
Geert Uytterhoeven
maintainerQuoted 10 lines · On Thu, Aug 11, 2011 at 06:47, <[email protected]> wrote:
arch/m68k/kernel/Makefile +3
-4@@ -1,5 +1,20 @@ -ifdef CONFIG_MMU -include arch/m68k/kernel/Makefile_mm -else -include arch/m68k/kernel/Makefile_no +# +# Makefile for the linux kernel. +#
arch/m68k/kernel/Makefile line 13
Quoted 10 lines
arch/m68k/kernel/Makefile +10
-0+ +extra-$(CONFIG_MMU) := head.o +extra-$(CONFIG_SUN3) := sun3-head.o +extra-y += vmlinux.lds + +obj-y := entry.o m68k_ksyms.o process.o ptrace.o setup.o signal.o \ + sys_m68k.o syscalltable.o time.o traps.o + +obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo +obj-$(CONFIG_MMU) += ints.o module.o devres.o
On MMU, we unconditionally build module.c.
arch/m68k/kernel/Makefile line 18
Quoted 5 lines
arch/m68k/kernel/Makefile +5
-0+devres-$(CONFIG_MMU) = ../../../kernel/irq/devres.o + +ifndef CONFIG_MMU +obj-y += init_task.o irq.o +obj-$(CONFIG_MODULES) += module.o
On nommu, it depends on CONFIG_MODULES.
However, most inside module.c is already protected by #ifdef CONFIG_MODULES. Except for module_fixup(), which is empty for nommu. After moving the whole module_fixup() inside #ifdef CONFIG_MMU, you can consolidate the module.o entry in the Makefile.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
Hi Geert,
Quoted 32 lines · Geert Uytterhoeven
Quoted 10 lines · On Thu, Aug 11, 2011 at 06:47,<[email protected]> wrote:
arch/m68k/kernel/Makefile +3
-4@@ -1,5 +1,20 @@ -ifdef CONFIG_MMU -include arch/m68k/kernel/Makefile_mm -else -include arch/m68k/kernel/Makefile_no +# +# Makefile for the linux kernel. +#arch/m68k/kernel/Makefile line 13
Quoted 10 lines
arch/m68k/kernel/Makefile +10
-0+ +extra-$(CONFIG_MMU) := head.o +extra-$(CONFIG_SUN3) := sun3-head.o +extra-y += vmlinux.lds + +obj-y := entry.o m68k_ksyms.o process.o ptrace.o setup.o signal.o \ + sys_m68k.o syscalltable.o time.o traps.o + +obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo +obj-$(CONFIG_MMU) += ints.o module.o devres.oOn MMU, we unconditionally build
module.c.arch/m68k/kernel/Makefile line 18
Quoted 5 lines
arch/m68k/kernel/Makefile +5
-0+devres-$(CONFIG_MMU) = ../../../kernel/irq/devres.o + +ifndef CONFIG_MMU +obj-y += init_task.o irq.o +obj-$(CONFIG_MODULES) += module.oOn nommu, it depends on
CONFIG_MODULES.
Quoted 4 lines
However, most inside
module.cis already protected by #ifdefCONFIG_MODULES. Except formodule_fixup(), which is empty for nommu. After moving the wholemodule_fixup()inside #ifdefCONFIG_MMU, you can consolidate the module.o entry in theMakefile.
Actually you don't even need to modify module.c to always build at the moment. I can move to always building module.o, it costs an extra 2 bytes in the final non-MMU/no-modules case :-)
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
Quoted 1 line · <[email protected]> writes:
+obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
I'd rather put ifndef CONFIG_MMU_SUN3 around it.
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Hi Andreas,
Quoted 5 lines · Andreas Schwab
Quoted 1 line · <[email protected]> writes:
+obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
I'd rather put ifndef
CONFIG_MMU_SUN3around it.
I agree. It is much more obvious what it is doing with the ifndef. I'll change it over to that.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com