Skip to contentSkip to conversation

sparc,sparc64: unify arch Makefile

PATCH New Sam Ravnborg 1 participant 1 message Nov 17, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 sparc,sparc64: unify arch Makefile

Unifying arch Makefile is a preparation for the unification of kernel/ as asm-offset.c lives here.
The unification required a small update of the top-level Makefile where sparc support got simpler.

With this update the sparc64 Kconfig file are no longer used and is deleted.
And the asm-offset.c file from sparc/kernel is now used so the sparc64 version is deleted.
The defconfig files were both copied to sparc/configs and logic was added to seelct the right one.

The content of the sparc64/Makefile is more or less verbatim copied to the sparc/Makefile. Further unification is possible after finalizing the other unification work.

---
 Makefile                                           |    9 ++--
 arch/sparc/Kconfig                                 |    5 ++
 arch/sparc/Makefile                                |   52 +++++++++++++++++++-
 .../sparc/{defconfig => configs/sparc32_defconfig} |    0
 .../defconfig => sparc/configs/sparc64_defconfig}  |    0
 arch/sparc/kernel/asm-offsets.c                    |    6 ++
 arch/sparc64/Kconfig                               |    1 -
 arch/sparc64/Makefile                              |   48 ------------------
 arch/sparc64/kernel/asm-offsets.c                  |    1 -
 9 files changed, 67 insertions(+), 55 deletions(-)
 rename arch/sparc/{defconfig => configs/sparc32_defconfig} (100%)
 rename arch/{sparc64/defconfig => sparc/configs/sparc64_defconfig} (100%)
 delete mode 100644 arch/sparc64/Kconfig
 delete mode 100644 arch/sparc64/Makefile
 delete mode 100644 arch/sparc64/kernel/asm-offsets.c
Makefile +5 -4
index d500817..6f659bb 100644
@@ -205,13 +205,14 @@ ifeq ($(ARCH),x86_64)
         SRCARCH := x86
 endif
 
-# Where to locate arch specific headers
+# Additional ARCH settings for sparc
 ifeq ($(ARCH),sparc64)
-       hdr-arch  := sparc
-else
-       hdr-arch  := $(SRCARCH)
+       SRCARCH := sparc
 endif
 
+# Where to locate arch specific headers
+hdr-arch  := $(SRCARCH)
+
 KCONFIG_CONFIG	?= .config
 
 # SHELL used by kbuild
arch/sparc/Kconfig +5 -0
index 7cf98a7..3e77d05 100644
@@ -41,6 +41,11 @@ config SPARC64
 	select RTC_DRV_SUN4V
 	select RTC_DRV_STARFIRE
 
+config ARCH_DEFCONFIG
+        string
+        default "arch/sparc/configs/sparc32_defconfig" if SPARC32
+        default "arch/sparc/configs/sparc64_defconfig" if SPARC64
+
 config 64BIT
 	def_bool y if SPARC64
 
arch/sparc/Makefile +51 -1

71 lines not on this page · raw message

arch/sparc/configs/sparc32_defconfig renamed from arch/sparc/defconfig +0 -0
similarity index 100%
rename from arch/sparc/defconfig
rename to arch/sparc/configs/sparc32_defconfig
arch/sparc/configs/sparc64_defconfig renamed from arch/sparc64/defconfig +0 -0
similarity index 100%
rename from arch/sparc64/defconfig
rename to arch/sparc/configs/sparc64_defconfig
arch/sparc/kernel/asm-offsets.c +6 -0
index b5bb99e..bdede71 100644
@@ -14,6 +14,8 @@
 // #include <linux/mm.h>
 #include <linux/kbuild.h>
 
+#ifdef CONFIG_SPARC32
+
 int foo(void)
 {
 	DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
@@ -26,3 +28,7 @@ int foo(void)
 	/* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */
 	return 0;
 }
+
+#else
+/* Nothing for sparc64 (yet) */
+#endif
arch/sparc64/Kconfig deleted +0 -1
deleted file mode 100644
index caa9421..0000000
@@ -1 +0,0 @@
-source arch/sparc/Kconfig
arch/sparc64/Makefile deleted +0 -48

48 lines not on this page · raw message

arch/sparc64/kernel/asm-offsets.c deleted +0 -1
deleted file mode 100644
index 9e26311..0000000
@@ -1 +0,0 @@
-/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */
Signature · 1 line
1.5.6.GIT