[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] pv-grub: On x86_64, also build an x86_32 pv-grub



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1218718008 -3600
# Node ID d3947223dfaeaf935ef36e7a43d4ef240ddf5c12
# Parent  ca7dd77d53652aa55be27746540ec50cb9608ec4
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@xxxxxxxxxxxxx>
---
 .hgignore               |   10 +---
 Makefile                |   12 +++++
 extras/mini-os/Makefile |    4 -
 stubdom/Makefile        |  102 +++++++++++++++++++++++++-----------------------
 stubdom/grub/Makefile   |   24 ++++++++---
 5 files changed, 88 insertions(+), 64 deletions(-)

diff -r ca7dd77d5365 -r d3947223dfae .hgignore
--- a/.hgignore Thu Aug 14 10:18:08 2008 +0100
+++ b/.hgignore Thu Aug 14 13:46:48 2008 +0100
@@ -90,20 +90,16 @@
 ^stubdom/gcc-.*$
 ^stubdom/include$
 ^stubdom/ioemu$
-^stubdom/libxc$
+^stubdom/libxc-.*$
 ^stubdom/lwip-.*$
 ^stubdom/mini-os-.*$
-^stubdom/mk-headers$
+^stubdom/mk-headers-.*$
 ^stubdom/newlib-.*$
 ^stubdom/pciutils-.*$
 ^stubdom/zlib-.*$
-^stubdom/grub-cvs$
-^stubdom/grub/stage2$
-^stubdom/grub/netboot$
-^stubdom/grub/dirs$
+^stubdom/grub-.*$
 ^stubdom/lwip/
 ^stubdom/ioemu/
-^stubdom/grub-upstream/
 ^tools/.*/build/lib.*/.*\.py$
 ^tools/blktap/Makefile\.smh$
 ^tools/blktap/drivers/blktapctrl$
diff -r ca7dd77d5365 -r d3947223dfae Makefile
--- a/Makefile  Thu Aug 14 10:18:08 2008 +0100
+++ b/Makefile  Thu Aug 14 13:46:48 2008 +0100
@@ -22,6 +22,9 @@ build: kernels
        $(MAKE) -C xen build
        $(MAKE) -C tools build
        $(MAKE) -C stubdom build
+ifeq (x86_64,$(XEN_TARGET_ARCH))
+       XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub
+endif
        $(MAKE) -C docs build
 
 # The test target is for unit tests that can run without an installation.  Of
@@ -71,6 +74,9 @@ install-kernels:
 .PHONY: install-stubdom
 install-stubdom:
        $(MAKE) -C stubdom install
+ifeq (x86_64,$(XEN_TARGET_ARCH))
+       XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
+endif
 
 .PHONY: install-docs
 install-docs:
@@ -109,6 +115,9 @@ clean::
        $(MAKE) -C xen clean
        $(MAKE) -C tools clean
        $(MAKE) -C stubdom crossclean
+ifeq (x86_64,$(XEN_TARGET_ARCH))
+       XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom crossclean
+endif
        $(MAKE) -C docs clean
 
 # clean, but blow away kernel build tree plus tarballs
@@ -117,6 +126,9 @@ distclean:
        $(MAKE) -C xen distclean
        $(MAKE) -C tools distclean
        $(MAKE) -C stubdom distclean
+ifeq (x86_64,$(XEN_TARGET_ARCH))
+       XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
+endif
        $(MAKE) -C docs distclean
        rm -rf dist patches/tmp
        for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
diff -r ca7dd77d5365 -r d3947223dfae extras/mini-os/Makefile
--- a/extras/mini-os/Makefile   Thu Aug 14 10:18:08 2008 +0100
+++ b/extras/mini-os/Makefile   Thu Aug 14 13:46:48 2008 +0100
@@ -66,8 +66,8 @@ ifeq ($(lwip),y)
 # lwIP library
 LWC    := $(shell find $(LWIPDIR)/ -type f -name '*.c')
 LWC    := $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC))
-LWC    += lwip-arch.c lwip-net.c
 LWO    := $(patsubst %.c,%.o,$(LWC))
+LWO    += $(addprefix $(OBJ_DIR)/,lwip-arch.o lwip-net.o)
 
 $(OBJ_DIR)/lwip.a: $(LWO)
        $(RM) $@
@@ -79,7 +79,7 @@ OBJS := $(filter-out $(OBJ_DIR)/lwip%.o 
 OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS))
 
 ifeq ($(libc),y)
-APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc -whole-archive -lxenguest -lxenctrl 
-no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(XEN_TARGET_ARCH) -whole-archive 
-lxenguest -lxenctrl -no-whole-archive
 APP_LDLIBS += -lpci
 APP_LDLIBS += -lz
 APP_LDLIBS += -lm
diff -r ca7dd77d5365 -r d3947223dfae stubdom/Makefile
--- a/stubdom/Makefile  Thu Aug 14 10:18:08 2008 +0100
+++ b/stubdom/Makefile  Thu Aug 14 13:46:48 2008 +0100
@@ -90,9 +90,9 @@ NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TAR
 NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a
 .PHONY: cross-newlib
 cross-newlib: $(NEWLIB_STAMPFILE)
-$(NEWLIB_STAMPFILE): mk-headers newlib-$(NEWLIB_VERSION)
-       mkdir -p newlib-build
-       ( cd newlib-build && \
+$(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
+       mkdir -p newlib-$(XEN_TARGET_ARCH)
+       ( cd newlib-$(XEN_TARGET_ARCH) && \
          CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) 
$(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) 
RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure 
--prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf 
--enable-newlib-io-long-long --disable-multilib && \
          $(MAKE) && \
          DESTDIR= $(MAKE) install )
@@ -104,12 +104,15 @@ zlib-$(ZLIB_VERSION).tar.gz:
 zlib-$(ZLIB_VERSION).tar.gz:
        $(WGET) $(ZLIB_URL)/$@
 
+zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz 
+       tar xzf $<
+       mv zlib-$(ZLIB_VERSION) $@
+
 ZLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libz.a
 .PHONY: cross-zlib
 cross-zlib: $(ZLIB_STAMPFILE)
-$(ZLIB_STAMPFILE): zlib-$(ZLIB_VERSION).tar.gz $(NEWLIB_STAMPFILE)
-       tar xzf $<
-       ( cd zlib-$(ZLIB_VERSION) && \
+$(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+       ( cd $< && \
          CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure 
--prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
          $(MAKE) libz.a && \
          $(MAKE) install )
@@ -121,16 +124,17 @@ pciutils-$(LIBPCI_VERSION).tar.bz2:
 pciutils-$(LIBPCI_VERSION).tar.bz2:
        $(WGET) $(LIBPCI_URL)/$@
 
-pciutils-$(LIBPCI_VERSION): pciutils-$(LIBPCI_VERSION).tar.bz2
+pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
        tar xjf $<
+       mv pciutils-$(LIBPCI_VERSION) $@
        patch -d $@ -p1 < pciutils.patch
        touch $@
 
 LIBPCI_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpci.a
 .PHONY: cross-libpci
 cross-libpci: $(LIBPCI_STAMPFILE)
-$(LIBPCI_STAMPFILE): pciutils-$(LIBPCI_VERSION) $(NEWLIB_STAMPFILE) 
$(ZLIB_STAMPFILE)
-       ( cd pciutils-$(LIBPCI_VERSION) && \
+$(LIBPCI_STAMPFILE): pciutils-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) 
$(ZLIB_STAMPFILE)
+       ( cd $< && \
          cp ../libpci.config.h lib/config.h && \
          echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
          cp ../libpci.config.mak lib/config.mk && \
@@ -147,8 +151,9 @@ lwip-$(LWIP_VERSION).tar.gz:
 lwip-$(LWIP_VERSION).tar.gz:
        $(WGET) $(LWIP_URL)/$@
 
-lwip: lwip-$(LWIP_VERSION).tar.gz
-       tar xzf $<
+lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
+       tar xzf $<
+       mv lwip $@
        patch -d $@ -p0 < lwip.patch-cvs
        touch $@
 
@@ -159,7 +164,7 @@ lwip: lwip-$(LWIP_VERSION).tar.gz
 .PHONY: $(CROSS_ROOT)
 $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 
-mk-headers:
+mk-headers-$(XEN_TARGET_ARCH):
        mkdir -p include/xen && \
           ln -sf $(addprefix ../../,$(wildcard 
$(XEN_ROOT)/xen/include/public/*.h)) include/xen && \
           ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 
arch-x86 hvm io xsm) include/xen && \
@@ -168,13 +173,13 @@ mk-headers:
          ln -sf $(addprefix ../../,$(wildcard 
$(XEN_ROOT)/tools/include/xen-foreign/*)) include/xen-foreign/ && \
          $(MAKE) -C include/xen-foreign/ && \
          ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign 
include/xen/foreign )
-       mkdir -p libxc
-       [ -h libxc/Makefile ] || ( cd libxc && \
+       mkdir -p libxc-$(XEN_TARGET_ARCH)
+       [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd 
libxc-$(XEN_TARGET_ARCH) && \
          ln -sf ../$(XEN_ROOT)/tools/libxc/*.h . && \
          ln -sf ../$(XEN_ROOT)/tools/libxc/*.c . && \
          ln -sf ../$(XEN_ROOT)/tools/libxc/Makefile . )
-       mkdir -p libxc/$(XEN_TARGET_ARCH)
-       [ -h libxc/$(XEN_TARGET_ARCH) ] || ( cd libxc/$(XEN_TARGET_ARCH) && \
+       mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH)
+       [ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd 
libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \
          ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
          ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
          ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
@@ -195,9 +200,9 @@ endif
        [ ! -h ioemu/config-host.h ] || rm -f ioemu/config-host.h
        [ ! -h ioemu/config-host.mak ] || rm -f ioemu/config-host.mak
        $(MAKE) -C $(MINI_OS) links
-       touch mk-headers
-
-TARGETS_MINIOS=$(addprefix mini-os-,$(TARGETS))
+       touch mk-headers-$(XEN_TARGET_ARCH)
+
+TARGETS_MINIOS=$(addprefix mini-os-$(XEN_TARGET_ARCH)-,$(TARGETS))
 $(TARGETS_MINIOS): mini-os-%:
        [ -d $@ ] || \
        for i in $$(cd $(MINI_OS) ; find . -type d) ; do \
@@ -209,9 +214,9 @@ TARGETS_MINIOS=$(addprefix mini-os-,$(TA
 #######
 
 .PHONY: libxc
-libxc: libxc/libxenctrl.a libxc/libxenguest.a
-libxc/libxenctrl.a libxc/libxenguest.a:: cross-zlib
-       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C libxc
+libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a 
libxc-$(XEN_TARGET_ARCH)/libxenguest.a
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a:: 
cross-zlib
+       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C 
libxc-$(XEN_TARGET_ARCH)
 
 #######
 # ioemu
@@ -223,12 +228,12 @@ ifeq ($(CONFIG_QEMU),ioemu)
        [ -f ioemu/config-host.mak ] || \
          ( cd ioemu ; \
           XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh 
configure --prefix=/usr --enable-stubdom $(IOEMU_OPTIONS))
-       CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip 
TOOLS=
+       CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu 
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS=
 else
        [ -f ioemu/config-host.mak ] || \
          ( cd ioemu ; \
           CONFIG_STUBDOM=yes XEN_ROOT=$(abspath $(XEN_ROOT)) 
XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh ./xen-setup 
--cc=$(CC) --disable-gcc-check $(IOEMU_OPTIONS))
-       CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu 
LWIPDIR=$(CURDIR)/lwip TOOLS= CONFIG_STUBDOM=yes
+       CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu 
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS= CONFIG_STUBDOM=yes
 endif
 
 ######
@@ -237,7 +242,7 @@ endif
 
 .PHONY: caml
 caml: $(CROSS_ROOT)
-       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ 
LWIPDIR=$(CURDIR)/lwip 
+       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ 
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ###
 # C
@@ -245,7 +250,7 @@ caml: $(CROSS_ROOT)
 
 .PHONY: c
 c: $(CROSS_ROOT)
-       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ 
LWIPDIR=$(CURDIR)/lwip 
+       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ 
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
 
 ######
 # Grub
@@ -263,7 +268,8 @@ grub-upstream: grub-$(GRUB_VERSION).tar.
 
 .PHONY: grub
 grub: grub-upstream $(CROSS_ROOT)
-       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
+       mkdir -p grub-$(XEN_TARGET_ARCH)
+       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ 
OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
 ########
 # minios
@@ -275,21 +281,21 @@ else
 else
 ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a 
$(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a
 endif
-ioemu-stubdom: mini-os-ioemu lwip libxc ioemu
-       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip APP_OBJS="$(APP_OBJS)"
+ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc 
ioemu
+       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
APP_OBJS="$(APP_OBJS)"
 
 CAMLLIB = $(shell ocamlc -where)
 .PHONY: caml-stubdom
-caml-stubdom: mini-os-caml lwip libxc caml
-       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_CAML 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip 
APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o 
$(CAMLLIB)/libasmrun.a"
+caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc 
caml
+       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_CAML 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
APP_OBJS="$(CURDIR)/caml/main-caml.o $(CURDIR)/caml/caml.o 
$(CAMLLIB)/libasmrun.a"
 
 .PHONY: c-stubdom
-c-stubdom: mini-os-c lwip libxc c
-       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_C 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip APP_OBJS=$(CURDIR)/c/main.a
+c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
+       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_C 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
APP_OBJS=$(CURDIR)/c/main.a
 
 .PHONY: pv-grub
-pv-grub: mini-os-grub libxc grub
-       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_GRUB 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub/main.a
+pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
+       DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_GRUB 
$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) 
OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
 
 #########
 # install
@@ -309,11 +315,11 @@ install-ioemu: ioemu-stubdom
        $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/bin"
        $(INSTALL_PROG) stubdom-dm "$(DESTDIR)/usr/lib/xen/bin"
        $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
-       $(INSTALL_DATA) mini-os-ioemu/mini-os.gz 
"$(DESTDIR)/usr/lib/xen/boot/ioemu-stubdom.gz"
+       $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz 
"$(DESTDIR)/usr/lib/xen/boot/ioemu-stubdom.gz"
 
 install-grub: pv-grub
        $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
-       $(INSTALL_DATA) mini-os-grub/mini-os.gz 
"$(DESTDIR)/usr/lib/xen/boot/pv-grub.gz"
+       $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz 
"$(DESTDIR)/usr/lib/xen/boot/pv-grub-$(XEN_TARGET_ARCH).gz"
 
 #######
 # clean
@@ -322,30 +328,30 @@ install-grub: pv-grub
 # Only clean the libxc/ioemu/mini-os part
 .PHONY: clean
 clean:
-       rm -fr mini-os-ioemu
-       rm -fr mini-os-c
-       rm -fr mini-os-caml
-       rm -fr mini-os-grub
+       rm -fr mini-os-$(XEN_TARGET_ARCH)-ioemu
+       rm -fr mini-os-$(XEN_TARGET_ARCH)-c
+       rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
+       rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
        $(MAKE) -C caml clean
        $(MAKE) -C c clean
-       $(MAKE) -C grub clean
-       [ ! -d libxc ] || $(MAKE) -C libxc clean
+       rm -fr grub-$(XEN_TARGET_ARCH)
+       [ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) -C 
libxc-$(XEN_TARGET_ARCH) clean
        [ ! -d ioemu ] || $(MAKE) -C ioemu clean
 
 # clean the cross-compilation result
 .PHONY: crossclean
 crossclean: clean
        rm -fr $(CROSS_ROOT)
-       rm -fr newlib-build
-       rm -fr zlib-$(ZLIB_VERSION) pciutils-$(LIBPCI_VERSION)
-       rm -fr libxc ioemu
-       rm -f mk-headers
+       rm -fr newlib-$(XEN_TARGET_ARCH)
+       rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
+       rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
+       rm -f mk-headers-$(XEN_TARGET_ARCH)
 
 # clean patched sources
 .PHONY: patchclean
 patchclean: crossclean
        rm -fr newlib-$(NEWLIB_VERSION)
-       rm -fr lwip
+       rm -fr lwip-$(XEN_TARGET_ARCH)
        rm -fr grub-upstream
 
 # clean downloads
diff -r ca7dd77d5365 -r d3947223dfae stubdom/grub/Makefile
--- a/stubdom/grub/Makefile     Thu Aug 14 10:18:08 2008 +0100
+++ b/stubdom/grub/Makefile     Thu Aug 14 13:46:48 2008 +0100
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/Config.mk
 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 += -DPRESET_MENU_STRING='""
 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/,$(
 
 $(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

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.