aboutsummaryrefslogtreecommitdiffstats
path: root/stubdom/grub
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-14 13:46:48 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-14 13:46:48 +0100
commit006e7188d48680d651cdf27a477b1af3b507de5d (patch)
tree07c4e93058752a893b4b4b8b9776ae6c20a2f7cd /stubdom/grub
parentf6c2c609f7ca5109c3871798ebb9966d0b08cdc0 (diff)
downloadxen-006e7188d48680d651cdf27a477b1af3b507de5d.tar.gz
xen-006e7188d48680d651cdf27a477b1af3b507de5d.tar.bz2
xen-006e7188d48680d651cdf27a477b1af3b507de5d.zip
pv-grub: On x86_64, also build an x86_32 pv-grub
This requires suffixing obj directories and having grub compiled outside sources. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'stubdom/grub')
-rw-r--r--stubdom/grub/Makefile24
1 files changed, 17 insertions, 7 deletions
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d24fbc0afc..77e5eb97d7 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -3,7 +3,7 @@ XEN_ROOT = ../..
include $(XEN_ROOT)/Config.mk
vpath %.c ../grub-upstream
-BOOT=boot-$(XEN_TARGET_ARCH).o
+BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc -I$(XEN_ROOT)/tools/include -I.
DEF_CPPFLAGS += -I../grub-upstream/stage1
@@ -17,7 +17,7 @@ DEF_CPPFLAGS += -DSUPPORT_SERIAL
DEF_CPPFLAGS += -DPRESET_MENU_STRING='""'
DEF_CPPFLAGS += -DPACKAGE='"grubdom"' -DVERSION='"0.97"'
-all: main.a
+all: $(OBJ_DIR)/main.a
STAGE2_SOURCES=builtins.c char_io.c cmdline.c common.c console.c disk_io.c graphics.c gunzip.c md5.c serial.c stage2.c terminfo.c tparm.c
@@ -59,16 +59,26 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
$(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
-OBJS = $(NETBOOT_SOURCES:.c=.o) $(STAGE2_SOURCES:.c=.o) kexec.o mini-os.o
+PV_GRUB_SOURCES = kexec.c mini-os.c
-dirs:
- mkdir -p netboot stage2
+SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
+
+OBJS = $(addprefix $(OBJ_DIR)/,$(SOURCES:.c=.o))
+
+$(OBJ_DIR)/dirs:
+ mkdir -p $(OBJ_DIR)/netboot $(OBJ_DIR)/stage2
touch $@
-$(OBJS): dirs
+$(OBJS): $(OBJ_DIR)/dirs
-main.a: $(BOOT) $(OBJS)
+$(OBJ_DIR)/main.a: $(BOOT) $(OBJS)
$(AR) cr $@ $^
+$(OBJ_DIR)/%.o: %.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
+
+$(OBJ_DIR)/%.o: %.S
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
+
clean:
rm -fr dirs *.a *.o stage2 netboot