From: Sam Ravnborg <sam@ravnborg.org>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: [PATCH 1/6] x86: move i386 and x86_64 Makefiles to arch/x86
Date: Thu, 25 Oct 2007 22:03:00 +0200 [thread overview]
Message-ID: <20071025200300.GB14501@uranus.ravnborg.org> (raw)
In-Reply-To: <20071025195644.GA14501@uranus.ravnborg.org>
>From 9d80894bef9805c70795f73ce1758d2a9e4cb077 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Thu, 25 Oct 2007 19:42:04 +0200
Subject: [PATCH] x86: move i386 and x86_64 Makefiles to arch/x86
Moving the ARCH specific Makefiles for i386 and x86_64
required a litle bit tweaking in the top-lvel Makefile.
SRCARCH is now set in the top-level Makefile
because we need this info to include the correct
arch Makefile.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
Makefile | 7 +++++--
arch/x86/Makefile | 13 +++++++++++++
arch/{i386/Makefile => x86/Makefile_32} | 7 ++-----
arch/{i386/Makefile.cpu => x86/Makefile_32.cpu} | 0
arch/{x86_64/Makefile => x86/Makefile_64} | 5 +----
5 files changed, 21 insertions(+), 11 deletions(-)
create mode 100644 arch/x86/Makefile
rename arch/{i386/Makefile => x86/Makefile_32} (98%)
rename arch/{i386/Makefile.cpu => x86/Makefile_32.cpu} (100%)
rename arch/{x86_64/Makefile => x86/Makefile_64} (99%)
diff --git a/Makefile b/Makefile
index 2a47290..8816060 100644
--- a/Makefile
+++ b/Makefile
@@ -196,6 +196,9 @@ CROSS_COMPILE ?=
UTS_MACHINE := $(ARCH)
SRCARCH := $(ARCH)
+# for i386 and x86_64 we use SRCARCH equal to x86
+SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH))
+
KCONFIG_CONFIG ?= .config
# SHELL used by kbuild
@@ -418,7 +421,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 %config: scripts_basic outputmakefile FORCE
@@ -497,7 +500,7 @@ else
KBUILD_CFLAGS += -O2
endif
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
new file mode 100644
index 0000000..65077d7
--- /dev/null
+++ b/arch/x86/Makefile
@@ -0,0 +1,13 @@
+# Unified Makefile for i386 and x86_64
+
+# No need to remake these files
+$(srctree)/arch/x86/Makefile%: ;
+
+ifeq ($(ARCH),i386)
+ include $(srctree)/arch/x86/Makefile_32
+else
+ include $(srctree)/arch/x86/Makefile_64
+endif
+
+
+
diff --git a/arch/i386/Makefile b/arch/x86/Makefile_32
similarity index 98%
rename from arch/i386/Makefile
rename to arch/x86/Makefile_32
index f5b9a37..346ac07 100644
--- a/arch/i386/Makefile
+++ b/arch/x86/Makefile_32
@@ -1,5 +1,5 @@
#
-# i386/Makefile
+# i386 Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
@@ -17,9 +17,6 @@
# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net>
# Added support for GEODE CPU
-# Fill in SRCARCH
-SRCARCH := x86
-
# BITS is used as extension for files which are available in a 32 bit
# and a 64 bit version to simplify shared Makefiles.
# e.g.: obj-y += foo_$(BITS).o
@@ -46,7 +43,7 @@ KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
# CPU-specific tuning. Anything which can be shared with UML should go here.
-include $(srctree)/arch/i386/Makefile.cpu
+include $(srctree)/arch/x86/Makefile_32.cpu
# temporary until string.h is fixed
cflags-y += -ffreestanding
diff --git a/arch/i386/Makefile.cpu b/arch/x86/Makefile_32.cpu
similarity index 100%
rename from arch/i386/Makefile.cpu
rename to arch/x86/Makefile_32.cpu
diff --git a/arch/x86_64/Makefile b/arch/x86/Makefile_64
similarity index 99%
rename from arch/x86_64/Makefile
rename to arch/x86/Makefile_64
index 20eb69b..57e714a 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86/Makefile_64
@@ -1,5 +1,5 @@
#
-# x86_64/Makefile
+# x86_64 Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
@@ -21,9 +21,6 @@
#
# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
-# Fill in SRCARCH
-SRCARCH := x86
-
# BITS is used as extension for files which are available in a 32 bit
# and a 64 bit version to simplify shared Makefiles.
# e.g.: obj-y += foo_$(BITS).o
--
1.5.3.4.1157.g0e74-dirty
next prev parent reply other threads:[~2007-10-25 20:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-25 19:56 [PATCH 0/6] kill i386 and x86_64 directories Sam Ravnborg
2007-10-25 20:03 ` Sam Ravnborg [this message]
2007-10-25 20:03 ` [PATCH 2/6] x86: move defconfig files for i386 and x86_64 to x86 Sam Ravnborg
2007-10-25 20:04 ` [PATCH 3/6] x86: unification of i386 and x86_64 Kconfig.debug Sam Ravnborg
2007-10-25 23:30 ` Yinghai Lu
2007-10-25 23:35 ` Randy Dunlap
2007-10-25 23:52 ` H. Peter Anvin
2007-10-26 1:55 ` Yinghai Lu
2007-10-26 4:29 ` Sam Ravnborg
2007-10-25 20:05 ` [PATCH 4/6] kconfig: small code refactoring in kconfig Makefile Sam Ravnborg
2007-10-25 20:05 ` [PATCH 5/6] x86: move i386 and x86_64 Kconfig files to x86 directory Sam Ravnborg
2007-10-26 1:53 ` Yinghai Lu
2007-10-26 2:46 ` Randy Dunlap
2007-10-26 5:51 ` Yinghai Lu
2007-10-26 6:02 ` Randy Dunlap
2007-10-26 6:14 ` Sam Ravnborg
2007-10-26 6:39 ` Yinghai Lu
2007-10-26 6:58 ` Sam Ravnborg
2007-10-25 20:06 ` [PATCH 6/6] x86: kill the old i386 and x86_64 directories Sam Ravnborg
2007-10-25 20:14 ` [PATCH 0/6] kill " Sam Ravnborg
2007-10-25 20:19 ` Kay Sievers
2007-10-25 20:36 ` Sam Ravnborg
2007-10-25 20:17 ` Thomas Gleixner
2007-10-25 21:12 ` [GIT PULL] " Sam Ravnborg
2007-10-26 6:23 ` [PATCH 0/6] " Sam Ravnborg
2007-10-26 12:01 ` Alan Cox
2007-10-26 14:39 ` Arjan van de Ven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071025200300.GB14501@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=hpa@zytor.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®