From b2fa72bb98ccb1a6dd71bc5c60e1b6e7248dd4d8 Mon Sep 17 00:00:00 2001 From: Jesus Sanchez-Palencia Date: Wed, 29 Apr 2015 14:58:29 -0300 Subject: [PATCH] x86: Break Makefile.x86 into common and pc specific ones Now the cpu/x86/ provides a Makefile.x86_common and a Makefile.x86_pc. The former includes the common Makefile and adds legacy pc specific implementations (currently, drivers only) into the building context, while the latter has everything that defines the bootstrap of a x86 CPU. This commit also fixes platform/galileo/ so it includes the correct makefile - Makefile.x86_quarkX1000. Galileo uses a Quark X1000 SoC which is not an IBM Generic PC-like CPU, but it does provide most of a PCs peripherals through its "Legacy Bridge". Thus, it makes sense that QuarkX1000's Makefile includes code from the legacy_pc x86 cpu. --- cpu/x86/{Makefile.x86 => Makefile.x86_common} | 6 +++--- cpu/x86/Makefile.x86_quarkX1000 | 5 +++++ platform/galileo/Makefile.galileo | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) rename cpu/x86/{Makefile.x86 => Makefile.x86_common} (81%) create mode 100644 cpu/x86/Makefile.x86_quarkX1000 diff --git a/cpu/x86/Makefile.x86 b/cpu/x86/Makefile.x86_common similarity index 81% rename from cpu/x86/Makefile.x86 rename to cpu/x86/Makefile.x86_common index 4cb49df37..ca14d0c96 100644 --- a/cpu/x86/Makefile.x86 +++ b/cpu/x86/Makefile.x86_common @@ -1,14 +1,14 @@ -CONTIKI_CPU_DIRS = . drivers/legacy_pc +CONTIKI_CPU_DIRS += . -CONTIKI_SOURCEFILES += gdt.c helpers.S idt.c cpu.c rtc.c pit.c pic.c +CONTIKI_SOURCEFILES += gdt.c helpers.S idt.c cpu.c -### Compiler definitions CC = gcc LD = gcc AS = as OBJCOPY = objcopy SIZE = size STRIP = strip + CFLAGSNO = -Wall -g -I/usr/local/include CFLAGS += $(CFLAGSNO) ifeq ($(HOST_OS),Linux) diff --git a/cpu/x86/Makefile.x86_quarkX1000 b/cpu/x86/Makefile.x86_quarkX1000 new file mode 100644 index 000000000..01f206d66 --- /dev/null +++ b/cpu/x86/Makefile.x86_quarkX1000 @@ -0,0 +1,5 @@ +include $(CONTIKI)/cpu/x86/Makefile.x86_common + +CONTIKI_CPU_DIRS += drivers/legacy_pc + +CONTIKI_SOURCEFILES += rtc.c pit.c pic.c diff --git a/platform/galileo/Makefile.galileo b/platform/galileo/Makefile.galileo index 15f693401..9d186f8c5 100644 --- a/platform/galileo/Makefile.galileo +++ b/platform/galileo/Makefile.galileo @@ -8,7 +8,7 @@ CONTIKI_SOURCEFILES += contiki-main.c newlib-syscalls.c loader.S clock.c rtimer- LINKERSCRIPT = $(CONTIKI)/platform/galileo/galileo.ld CONTIKI_CPU=$(CONTIKI)/cpu/x86 -include $(CONTIKI)/cpu/x86/Makefile.x86 +include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000 CFLAGS += -m32 -march=i586 -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed LDFLAGS += -m32 -nostdlib -T $(LINKERSCRIPT)