ia64/xen-unstable

view stubdom/grub/Makefile @ 18330:d3947223dfae

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Aug 14 13:46:48 2008 +0100 (2008-08-14)
parents 6f82840f173b
children
line source
1 XEN_ROOT = ../..
3 include $(XEN_ROOT)/Config.mk
4 vpath %.c ../grub-upstream
6 BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
8 DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc -I$(XEN_ROOT)/tools/include -I.
9 DEF_CPPFLAGS += -I../grub-upstream/stage1
10 DEF_CPPFLAGS += -I../grub-upstream/stage2
11 DEF_CPPFLAGS += -I../grub-upstream/netboot
12 DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/firmware/vgabios
13 DEF_CPPFLAGS += -DWITHOUT_LIBC_STUBS
14 DEF_CPPFLAGS += -DSUPPORT_NETBOOT
15 DEF_CPPFLAGS += -DSUPPORT_GRAPHICS
16 DEF_CPPFLAGS += -DSUPPORT_SERIAL
17 DEF_CPPFLAGS += -DPRESET_MENU_STRING='""'
18 DEF_CPPFLAGS += -DPACKAGE='"grubdom"' -DVERSION='"0.97"'
20 all: $(OBJ_DIR)/main.a
22 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
24 NETBOOT_SOURCES=fsys_tftp.c main.c misc.c
25 CPPFLAGS += -DFSYS_TFTP=1
27 STAGE2_SOURCES+=fsys_ext2fs.c
28 CPPFLAGS += -DFSYS_EXT2FS=1
30 STAGE2_SOURCES+=fsys_fat.c
31 CPPFLAGS += -DFSYS_FAT=1
33 STAGE2_SOURCES+=fsys_ffs.c
34 CPPFLAGS += -DFSYS_FFS=1
36 STAGE2_SOURCES+=fsys_iso9660.c
37 CPPFLAGS += -DFSYS_ISO9660=1
39 STAGE2_SOURCES+=fsys_jfs.c
40 CPPFLAGS += -DFSYS_JFS=1
42 STAGE2_SOURCES+=fsys_minix.c
43 CPPFLAGS += -DFSYS_MINIX=1
45 STAGE2_SOURCES+=fsys_reiserfs.c
46 CPPFLAGS += -DFSYS_REISERFS=1
48 STAGE2_SOURCES+=fsys_ufs2.c
49 CPPFLAGS += -DFSYS_UFS2=1
51 STAGE2_SOURCES+=fsys_vstafs.c
52 CPPFLAGS += -DFSYS_VSTAFS=1
54 STAGE2_SOURCES+=fsys_xfs.c
55 CPPFLAGS += -DFSYS_XFS=1
57 STAGE2_SOURCES:=$(addprefix stage2/,$(STAGE2_SOURCES))
58 NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
60 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
62 PV_GRUB_SOURCES = kexec.c mini-os.c
64 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
66 OBJS = $(addprefix $(OBJ_DIR)/,$(SOURCES:.c=.o))
68 $(OBJ_DIR)/dirs:
69 mkdir -p $(OBJ_DIR)/netboot $(OBJ_DIR)/stage2
70 touch $@
72 $(OBJS): $(OBJ_DIR)/dirs
74 $(OBJ_DIR)/main.a: $(BOOT) $(OBJS)
75 $(AR) cr $@ $^
77 $(OBJ_DIR)/%.o: %.c
78 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
80 $(OBJ_DIR)/%.o: %.S
81 $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
83 clean:
84 rm -fr dirs *.a *.o stage2 netboot