From 337657367b698fab96222708a09a310490a725dd Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 3 Dec 2011 11:13:20 +0800 Subject: [PATCH] Build - Cleaning up distinction between architectures and configs --- BuildConf/x86/smp.mk | 1 + BuildConf/x86_smp | 1 - Kernel/Makefile | 27 +++++++++++++++++---------- Kernel/arch/armv7/Makefile | 11 +---------- Kernel/arch/x86/Makefile | 5 ++--- 5 files changed, 21 insertions(+), 24 deletions(-) create mode 120000 BuildConf/x86/smp.mk delete mode 120000 BuildConf/x86_smp diff --git a/BuildConf/x86/smp.mk b/BuildConf/x86/smp.mk new file mode 120000 index 00000000..1296c196 --- /dev/null +++ b/BuildConf/x86/smp.mk @@ -0,0 +1 @@ +default.mk \ No newline at end of file diff --git a/BuildConf/x86_smp b/BuildConf/x86_smp deleted file mode 120000 index ef2bea7f..00000000 --- a/BuildConf/x86_smp +++ /dev/null @@ -1 +0,0 @@ -x86/ \ No newline at end of file diff --git a/Kernel/Makefile b/Kernel/Makefile index c972ed48..2b2d96ff 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -15,29 +15,38 @@ BUILD_NUM = 0 endif KERNEL_VERSION = $(ACESS_VERSION) - MAKEDEP = $(CC) -M +ifeq ($(AS_SUFFIX),) + AS_SUFFIX = S +endif + +ASFLAGS += -D ARCHDIR_IS_$(ARCHDIR)=1 -DCONFIG_is_$(CONFIG)=1 CPPFLAGS += -I./include -I./arch/$(ARCHDIR)/include -D_MODULE_NAME_=\"Kernel\" -CPPFLAGS += -DARCH=$(ARCH) -DARCHDIR=$(ARCHDIR) -DARCHDIR_IS_$(ARCHDIR)=1 +CPPFLAGS += -DARCH=$(ARCH) -DARCHDIR=$(ARCHDIR) -DARCHDIR_IS_$(ARCHDIR)=1 -DCONFIG_is_$(CONFIG)=1 CPPFLAGS += -DKERNEL_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 -OBJDIR := obj-$(ARCH)/ -#OBJSUFFIX := .$(ARCH) +ifeq ($(CONFIG),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 +endif ifeq ($(DEBUG_BUILD),yes) LDFLAGS += -g CFLAGS += -g endif -ifeq ($(AS_SUFFIX),) - AS_SUFFIX = S -endif - BUILDINFO_OBJ := $(OBJDIR)buildinfo.o$(OBJSUFFIX) BUILDINFO_SRC := $(OBJDIR)buildinfo.c$(OBJSUFFIX) @@ -56,8 +65,6 @@ OBJ := $(addsuffix $(OBJSUFFIX), $(OBJ)) OBJ := $(addprefix $(OBJDIR), $(OBJ)) MODS += $(addprefix ../Modules/, $(addsuffix .xo.$(ARCH),$(MODULES))) -BIN = ../Acess2.$(ARCH).bin -GZBIN = ../Acess2.$(ARCH).gz DEPFILES := $(OBJ:%$(OBJSUFFIX)=%.dep$(OBJSUFFIX)) diff --git a/Kernel/arch/armv7/Makefile b/Kernel/arch/armv7/Makefile index 67bea82b..b041aa96 100644 --- a/Kernel/arch/armv7/Makefile +++ b/Kernel/arch/armv7/Makefile @@ -7,17 +7,8 @@ CPPFLAGS = CFLAGS = ASFLAGS = -PCI_ADDRESS=0 -ifeq ($(ARCH),integrator-cp) - MMU_PRESENT=1 -else - MMU_PRESENT=1 -endif - - - ASFLAGS += -DCONFIG_is_$(CONFIG)=1 -CPPFLAGS += -DMMU_PRESENT=$(MMU_PRESENT) -DPCI_ADDRESS=$(PCI_ADDRESS) -DCONFIG_is_$(CONFIG)=1 +CPPFLAGS += -DMMU_PRESENT=$(MMU_PRESENT) 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/x86/Makefile b/Kernel/arch/x86/Makefile index 10cd645b..0683d586 100644 --- a/Kernel/arch/x86/Makefile +++ b/Kernel/arch/x86/Makefile @@ -11,13 +11,12 @@ ASFLAGS = -f elf USE_MP=0 -ifeq ($(ARCH),x86) +ifeq ($(CONFIG),default) USE_MP=0 -else ifeq ($(ARCH),x86-smp) +else ifeq ($(CONFIG),smp) USE_MP=1 endif -#ASFLAGS += -D ARCH=\"$(ARCH)\" -D ARCHDIR=\"$(ARCHDIR)\" ASFLAGS += -D USE_MP=$(USE_MP) CPPFLAGS += -DUSE_MP=$(USE_MP) -- 2.20.1