Patchwork [19/40] xenner: kernel: Makefile

login
register
mail settings
Submitter Alexander Graf
Date Nov. 1, 2010, 3:01 p.m.
Message ID <1288623713-28062-20-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/69780/
State New
Headers show

Comments

Alexander Graf - Nov. 1, 2010, 3:01 p.m.
This patch adds the Makefile to build the xenner kernel.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 pc-bios/xenner/Makefile |   72 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/xenner/Makefile

Patch

diff --git a/pc-bios/xenner/Makefile b/pc-bios/xenner/Makefile
new file mode 100644
index 0000000..f768e0b
--- /dev/null
+++ b/pc-bios/xenner/Makefile
@@ -0,0 +1,72 @@ 
+all: build-all
+# Dummy command so that make thinks it has done something
+	@true
+
+include ../../config-host.mak
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/pc-bios/xenner)
+
+.PHONY : all clean build-all
+
+CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -g
+CFLAGS += -I$(SRC_PATH) -D__XEN_TOOLS__
+CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+QXENNER_CFLAGS = $(CFLAGS)
+
+build-all: xenner32.elf xenner32-pae.elf xenner64.elf
+
+
+XENNERXX_OBJS := xenner-hcall.o xenner-data.o xenner-instr.o xenner-pv.o xenner-lapic.o \
+		printk.o xen-names.o
+XENNER32_OBJS := xenner32.o xenner-main32.o xenner-hcall32.o $(XENNERXX_OBJS)
+XENNER32_NOPAE_OBJS := $(patsubst %,%32,$(XENNER32_OBJS)) xenner-mm32.o
+XENNER32_PAE_OBJS := $(patsubst %,%pae,$(XENNER32_OBJS)) xenner-mmpae.o
+XENNER64_OBJS := xenner64.o xenner-main64.o xenner-hcall64.o xenner-mm64.o \
+		$(patsubst %,%64,$(XENNERXX_OBJS))
+
+xenner32.elf : CFLAGS  += -m32 -ffreestanding -DCONFIG_32BIT
+xenner32.elf : ASFLAGS += -m32 -DCONFIG_32BIT
+
+xenner32-pae.elf : CFLAGS  += -m32 -ffreestanding -DCONFIG_PAE -DCONFIG_32BIT
+xenner32-pae.elf : ASFLAGS += -m32 -DCONFIG_PAE -DCONFIG_32BIT
+
+xenner64.elf : CFLAGS  += -m64 -ffreestanding -fpic -mno-red-zone -DCONFIG_64BIT
+xenner64.elf : ASFLAGS += -m64 -DCONFIG_64BIT
+
+xenner32.elf: $(XENNER32_NOPAE_OBJS)
+xenner32-pae.elf: $(XENNER32_PAE_OBJS)
+xenner64.elf: $(XENNER64_OBJS)
+
+clean:
+	rm -f *.o32 *.o64 *.opae *.o *.d *.raw *.img *.bin *.elf *~
+
+
+##############################################################################
+
+%.o32: %.c
+	$(call quiet-command,$(CC) -m32 $(QXENNER_CFLAGS) $(QXENNER_DGFLAGS) \
+            $(CFLAGS) -c -o $@ $<,"  CC    $(TARGET_DIR)$@") -DCONFIG_32BIT
+
+%.o32: %.S
+	$(call quiet-command,$(CC) -m32 $(QXENNER_CFLAGS) $(QXENNER_DGFLAGS) \
+            $(CFLAGS) -c -o $@ $<,"  AS    $(TARGET_DIR)$@") -DCONFIG_32BIT
+
+%.opae: %.c
+	$(call quiet-command,$(CC) -m32 $(QXENNER_CFLAGS) $(QXENNER_DGFLAGS) \
+            $(CFLAGS) -c -o $@ $<,"  CC    $(TARGET_DIR)$@") -DCONFIG_PAE    \
+            -DCONFIG_32BIT
+
+%.opae: %.S
+	$(call quiet-command,$(CC) -m32 $(QXENNER_CFLAGS) $(QXENNER_DGFLAGS) \
+            $(CFLAGS) -c -o $@ $<,"  AS    $(TARGET_DIR)$@") -DCONFIG_PAE    \
+            -DCONFIG_32BIT
+
+%.o64: %.c
+	$(call quiet-command,$(CC) -m64 $(QXENNER_CFLAGS) $(QXENNER_DGFLAGS) \
+            $(CFLAGS) -c -o $@ $<,"  CC    $(TARGET_DIR)$@") -DCONFIG_64BIT
+
+%.elf:
+	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-N -Wl,-T,$*.lds $^
+
+##############################################################################