From 5c9b3d1affd5f041ab9ea73746c6b51ddca14398 Mon Sep 17 00:00:00 2001
From: John Hodge <tpg@mutabah.net>
Date: Sat, 3 Dec 2011 12:00:15 +0800
Subject: [PATCH] Build - Renamed $(CONFIG) to $(PLATFORM)

---
 BuildConf/armv7/Makefile.cfg        |  5 ++++-
 BuildConf/armv7/default.mk          |  6 ++++--
 Kernel/Makefile                     | 16 ++++++++--------
 Kernel/arch/armv7/Makefile          |  3 +--
 Kernel/arch/armv7/include/options.h |  4 ++--
 Kernel/arch/x86/Makefile            |  4 ++--
 Makefile.cfg                        |  6 +++---
 RunQemuArm                          |  2 +-
 8 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/BuildConf/armv7/Makefile.cfg b/BuildConf/armv7/Makefile.cfg
index f5fa2615..9be93a74 100644
--- a/BuildConf/armv7/Makefile.cfg
+++ b/BuildConf/armv7/Makefile.cfg
@@ -9,5 +9,8 @@ STRIP = arm-elf-strip
 
 ASSUFFIX = S
 
-CONFIG=realview_pb
+# Default Configuration
+ifeq ($(PLATFORM),)
+	PLATFORM=realview_pb
+endif
 
diff --git a/BuildConf/armv7/default.mk b/BuildConf/armv7/default.mk
index 0a85c928..29ef50a8 100644
--- a/BuildConf/armv7/default.mk
+++ b/BuildConf/armv7/default.mk
@@ -1,7 +1,9 @@
 
-ifeq ($(CONFIG),default)
-	$(error Please select a configuration)
+ifeq ($(PLATFORM),default)
+	$(error Please select a platform)
 endif
 
+# Core ARMv7 modules
+
 MODULES += armv7/GIC
 MODULES += Filesystems/InitRD
diff --git a/Kernel/Makefile b/Kernel/Makefile
index 96626e10..c3fbc563 100644
--- a/Kernel/Makefile
+++ b/Kernel/Makefile
@@ -21,25 +21,25 @@ ifeq ($(AS_SUFFIX),)
 	AS_SUFFIX = S
 endif
 
-ASFLAGS         += -D ARCHDIR_IS_$(ARCHDIR)=1 -DCONFIG_is_$(CONFIG)=1
+ASFLAGS         += -D ARCHDIR_IS_$(ARCHDIR)=1 -D PLATFORM_is_$(PLATFORM)=1
 CPPFLAGS	+= -I./include -I./arch/$(ARCHDIR)/include -D_MODULE_NAME_=\"Kernel\"
-CPPFLAGS	+= -DARCH=$(ARCH) -DARCHDIR=$(ARCHDIR) -DARCHDIR_IS_$(ARCHDIR)=1 -DCONFIG_is_$(CONFIG)=1
-CPPFLAGS	+= -DKERNEL_VERSION=$(KERNEL_VERSION)
+CPPFLAGS	+= -D ARCH=$(ARCH) -D ARCHDIR=$(ARCHDIR) -D ARCHDIR_IS_$(ARCHDIR)=1 -D PLATFORM_is_$(PLATFORM)=1
+CPPFLAGS	+= -D KERNEL_VERSION=$(KERNEL_VERSION)
 CFLAGS  	+= -Wall -fno-stack-protector -Wstrict-prototypes -g
 CFLAGS  	+= -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wuninitialized
 CFLAGS          += -O3
 LDFLAGS		+= -T arch/$(ARCHDIR)/link.ld -g
 
-ifeq ($(CONFIG),default)
+ifeq ($(PLATFORM),default)
 	OBJDIR := obj-$(ARCH)/
 	#OBJSUFFIX := .$(ARCH)
 	BIN := ../Acess2.$(ARCH).bin
 	GZBIN := ../Acess2.$(ARCH).gz
 else
-	OBJDIR := obj-$(ARCH)-$(CONFIG)/
-	#OBJSUFFIX := .$(ARCH)-$(CONFIG)
-	BIN := ../Acess2.$(ARCH)-$(CONFIG).bin
-	GZBIN := ../Acess2.$(ARCH)-$(CONFIG).gz
+	OBJDIR := obj-$(ARCH)-$(PLATFORM)/
+	#OBJSUFFIX := .$(ARCH)-$(PLATFORM)
+	BIN := ../Acess2.$(ARCH)-$(PLATFORM).bin
+	GZBIN := ../Acess2.$(ARCH)-$(PLATFORM).gz
 endif
 
 ifeq ($(DEBUG_BUILD),yes)
diff --git a/Kernel/arch/armv7/Makefile b/Kernel/arch/armv7/Makefile
index b041aa96..2a86424f 100644
--- a/Kernel/arch/armv7/Makefile
+++ b/Kernel/arch/armv7/Makefile
@@ -7,8 +7,7 @@ CPPFLAGS	=
 CFLAGS		=
 ASFLAGS		=
 
-ASFLAGS += -DCONFIG_is_$(CONFIG)=1
-CPPFLAGS += -DMMU_PRESENT=$(MMU_PRESENT)
+CPPFLAGS += -DMMU_PRESENT=1
 LDFLAGS += `$(CC) --print-libgcc-file-name`
 
 A_OBJ  = start.ao main.o lib.o lib.ao time.o pci.o debug.o
diff --git a/Kernel/arch/armv7/include/options.h b/Kernel/arch/armv7/include/options.h
index fad529e9..ffbaa127 100644
--- a/Kernel/arch/armv7/include/options.h
+++ b/Kernel/arch/armv7/include/options.h
@@ -12,7 +12,7 @@
 
 //#define PCI_PADDR	0x60000000	// Realview (Non-PB)
 
-#if CONFIG_is_realview_pb
+#if PLATFORM_is_realview_pb
 # define UART0_PADDR	0x10009000	// Realview
 # define GICI_PADDR	0x1e000000
 # define GICD_PADDR	0x1e001000
@@ -20,7 +20,7 @@
 
 #endif
 
-#if CONFIG_is_trimslice	// Tegra2
+#if PLATFORM_is_trimslice	// Tegra2
 # define UART0_PADDR	0x70006000
 # define GICD_PADDR	0x50041000
 # define GICI_PADDR	0x60004000	// TODO: Is this actually a GIC-I?
diff --git a/Kernel/arch/x86/Makefile b/Kernel/arch/x86/Makefile
index 0683d586..c83a5af2 100644
--- a/Kernel/arch/x86/Makefile
+++ b/Kernel/arch/x86/Makefile
@@ -11,9 +11,9 @@ ASFLAGS		= -f elf
 
 USE_MP=0
 
-ifeq ($(CONFIG),default)
+ifeq ($(PLATFORM),default)
 	USE_MP=0
-else ifeq ($(CONFIG),smp)
+else ifeq ($(PLATFORM),smp)
 	USE_MP=1
 endif
 
diff --git a/Makefile.cfg b/Makefile.cfg
index 716eb5fc..d14b29c2 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -40,8 +40,8 @@ ifneq ($(ARCH),host)
  endif
 endif
 
-ifeq ($(CONFIG),)
-	CONFIG := default
+ifeq ($(PLATFORM),)
+	PLATFORM := default
 endif
 
 # Makefile.user.cfg is not part of the Acess git repo,
@@ -55,7 +55,7 @@ MODULES += Filesystems/Ext2
 MODULES += Filesystems/FAT
 MODULES += Filesystems/NTFS
 
-include $(ACESSDIR)/BuildConf/$(ARCH)/$(CONFIG).mk
+include $(ACESSDIR)/BuildConf/$(ARCH)/$(PLATFORM).mk
 
 MODULES += IPStack	# So the other modules are loaded before it
 #DYNMODS := USB/Core
diff --git a/RunQemuArm b/RunQemuArm
index b15d6176..f506599e 100755
--- a/RunQemuArm
+++ b/RunQemuArm
@@ -5,7 +5,7 @@ QEMU=qemu-system-arm
 USE_GDB=
 
 _SYSTEM=realview-pb-a8
-_KERNEL=Acess2.armv7.bin
+_KERNEL=Acess2.armv7-realview_pb.bin
 
 QEMU_PARAMS=""
 _NETTYPE="user"
-- 
GitLab