debuggers.hg

annotate stubdom/Makefile @ 18522:f03b0cc33576

stubdom/ioemu link farm creation fixes

Replace the stubdom/ioemu link farm creation in stubdom/Makefile,
with code which arranges that:
* No symlinks are made for output files - in particular, any
symlinks for .d files would be written through by the compiler
and cause damage to the original tree and other strange
behaviours
* All subdirectories are made as local subdirectories rather than
links
* Any interrupted or half-completed creation of the link farm
leaves the directory in a state where the link farming will be
restarted
* We use make's inherent ability to test for the existence of files
rather than using [ -f ... ] at the start of the rule's commands
* The list of files to be excluded from the link farm can be
easily updated
etc.

This should fix some problems particularly with parallel builds,
or by-hand builds where directories are entered in other than the
usual order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Sep 16 12:44:26 2008 +0100 (2008-09-16)
parents e827c54462d3
children 71d3d3ac23b8
rev   line source
keir@18447 1 XEN_ROOT = ..
keir@17905 2 MINI_OS = $(XEN_ROOT)/extras/mini-os
keir@17066 3
keir@17070 4 export XEN_OS=MiniOS
keir@17070 5
keir@17066 6 export stubdom=y
keir@17066 7 export debug=y
keir@18007 8 include $(XEN_ROOT)/Config.mk
keir@17066 9
keir@18412 10 IOEMU_OPTIONS=--disable-sdl --disable-opengl --disable-vnc-tls --disable-brlapi --disable-kqemu
keir@18281 11 ZLIB_URL?=http://www.zlib.net
keir@17066 12 ZLIB_VERSION=1.2.3
keir@18281 13 LIBPCI_URL?=http://www.kernel.org/pub/software/utils/pciutils
keir@17066 14 LIBPCI_VERSION=2.2.9
keir@18281 15 NEWLIB_URL?=ftp://sources.redhat.com/pub/newlib
keir@18034 16 NEWLIB_VERSION=1.16.0
keir@18281 17 LWIP_URL?=http://download.savannah.gnu.org/releases/lwip
keir@18114 18 LWIP_VERSION=1.3.0
keir@18281 19 GRUB_URL?=http://alpha.gnu.org/gnu/grub
keir@18113 20 GRUB_VERSION=0.97
keir@17066 21
keir@17066 22 WGET=wget -c
keir@17066 23
keir@17066 24 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
keir@17066 25 ifeq ($(XEN_TARGET_ARCH),x86_32)
keir@17066 26 GNU_TARGET_ARCH:=i686
keir@17066 27 endif
keir@17066 28
keir@17066 29 ifeq ($(GNU_TARGET_ARCH), i686)
keir@17066 30 TARGET_CFLAGS=
keir@17830 31 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
keir@18034 32 STUBDOM_SUPPORTED=1
keir@17066 33 endif
keir@17066 34 ifeq ($(GNU_TARGET_ARCH), x86_64)
keir@17066 35 TARGET_CFLAGS=-mno-red-zone
keir@17830 36 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
keir@18034 37 STUBDOM_SUPPORTED=1
keir@17066 38 endif
keir@17066 39 ifeq ($(GNU_TARGET_ARCH), ia64)
keir@17066 40 TARGET_CFLAGS=-mconstant-gp
keir@17066 41 endif
keir@17066 42
keir@17066 43 CROSS_ROOT=cross-root-$(GNU_TARGET_ARCH)
keir@17066 44 CROSS_PREFIX=$(CURDIR)/$(CROSS_ROOT)
keir@18007 45
keir@18007 46 # Disable PIE/SSP if GCC supports them. They can break us.
keir@18007 47 TARGET_CFLAGS += $(CFLAGS)
keir@18007 48 TARGET_CPPFLAGS += $(CPPFLAGS)
keir@18007 49 TARGET_CFLAGS += $(call cc-option,$(CC),-nopie,)
keir@18007 50 TARGET_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
keir@18007 51 TARGET_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
keir@18007 52
keir@18007 53 # Do not use host headers and libs
keir@18430 54 GCC_INSTALL = $(shell LANG=C gcc -print-search-dirs | sed -n -e 's/install: \(.*\)/\1/p')
keir@18007 55 TARGET_CPPFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__
keir@18055 56 TARGET_CPPFLAGS += -nostdinc
keir@18069 57 TARGET_CPPFLAGS += -isystem $(CURDIR)/$(MINI_OS)/include/posix
keir@18007 58 TARGET_CPPFLAGS += -isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include
keir@18007 59 TARGET_CPPFLAGS += -isystem $(GCC_INSTALL)include
keir@18510 60 TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-$(XEN_TARGET_ARCH)/src/include
keir@18510 61 TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-$(XEN_TARGET_ARCH)/src/include/ipv4
keir@18044 62 TARGET_CPPFLAGS += -I$(CURDIR)/include
keir@18007 63
keir@18007 64 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
keir@17066 65
keir@17909 66 TARGETS=ioemu c caml grub
keir@17905 67
keir@17066 68 .PHONY: all
keir@18034 69 all: build
keir@18034 70 ifeq ($(STUBDOM_SUPPORTED),1)
keir@18034 71 build: ioemu-stubdom c-stubdom pv-grub
keir@18034 72 else
keir@18034 73 build:
keir@18034 74 endif
keir@17066 75
keir@17066 76 ##############
keir@17066 77 # Cross-newlib
keir@17066 78 ##############
keir@17066 79
keir@18034 80 newlib-$(NEWLIB_VERSION).tar.gz:
keir@18281 81 $(WGET) $(NEWLIB_URL)/$@
keir@18034 82
keir@18034 83 newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
keir@18034 84 tar xzf $<
keir@17905 85 patch -d $@ -p0 < newlib.patch
keir@18034 86 touch $@
keir@17066 87
keir@17066 88 NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a
keir@17066 89 .PHONY: cross-newlib
keir@17066 90 cross-newlib: $(NEWLIB_STAMPFILE)
keir@18368 91 $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
keir@18368 92 mkdir -p newlib-$(XEN_TARGET_ARCH)
keir@18368 93 ( cd newlib-$(XEN_TARGET_ARCH) && \
keir@18034 94 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 && \
keir@17066 95 $(MAKE) && \
keir@18034 96 DESTDIR= $(MAKE) install )
keir@17066 97
keir@17066 98 ############
keir@17066 99 # Cross-zlib
keir@17066 100 ############
keir@17066 101
keir@17066 102 zlib-$(ZLIB_VERSION).tar.gz:
keir@18281 103 $(WGET) $(ZLIB_URL)/$@
keir@17066 104
keir@18368 105 zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz
keir@18368 106 tar xzf $<
keir@18368 107 mv zlib-$(ZLIB_VERSION) $@
keir@18368 108
keir@17066 109 ZLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libz.a
keir@17066 110 .PHONY: cross-zlib
keir@17066 111 cross-zlib: $(ZLIB_STAMPFILE)
keir@18368 112 $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
keir@18368 113 ( cd $< && \
keir@18007 114 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
keir@17066 115 $(MAKE) libz.a && \
keir@17066 116 $(MAKE) install )
keir@17066 117
keir@17066 118 ##############
keir@17066 119 # Cross-libpci
keir@17066 120 ##############
keir@17066 121
keir@17066 122 pciutils-$(LIBPCI_VERSION).tar.bz2:
keir@18281 123 $(WGET) $(LIBPCI_URL)/$@
keir@17066 124
keir@18368 125 pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
keir@17984 126 tar xjf $<
keir@18368 127 mv pciutils-$(LIBPCI_VERSION) $@
keir@17984 128 patch -d $@ -p1 < pciutils.patch
keir@17984 129 touch $@
keir@17984 130
keir@17066 131 LIBPCI_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpci.a
keir@17066 132 .PHONY: cross-libpci
keir@17066 133 cross-libpci: $(LIBPCI_STAMPFILE)
keir@18368 134 $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) $(ZLIB_STAMPFILE)
keir@18368 135 ( cd $< && \
keir@17066 136 cp ../libpci.config.h lib/config.h && \
keir@17066 137 echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
keir@17066 138 cp ../libpci.config.mak lib/config.mk && \
keir@18007 139 $(MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(realpath $(MINI_OS)/include)" lib/libpci.a && \
keir@17066 140 $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
keir@17066 141 $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
keir@18259 142 $(INSTALL_DATA) lib/config.h lib/header.h lib/pci.h lib/types.h $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci/ \
keir@17066 143 )
keir@17066 144
keir@17066 145 ######
keir@17066 146 # lwIP
keir@17066 147 ######
keir@17066 148
keir@18114 149 lwip-$(LWIP_VERSION).tar.gz:
keir@18281 150 $(WGET) $(LWIP_URL)/$@
keir@18114 151
keir@18368 152 lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
keir@18114 153 tar xzf $<
keir@18368 154 mv lwip $@
keir@18114 155 patch -d $@ -p0 < lwip.patch-cvs
keir@18114 156 touch $@
keir@17066 157
keir@17066 158 #######
keir@17066 159 # Links
keir@17066 160 #######
keir@17066 161
keir@17066 162 .PHONY: $(CROSS_ROOT)
keir@17066 163 $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
keir@17066 164
keir@18510 165 $(XEN_ROOT)/tools/ioemu-dir:
keir@18510 166 make -C $(XEN_ROOT)/tools ioemu-dir-find
keir@18510 167
keir@18522 168 ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir
keir@18522 169 mkdir -p ioemu
keir@18522 170 ifeq ($(CONFIG_QEMU),ioemu)
keir@18522 171 [ -h ioemu/Makefile ] || ( cd ioemu && \
keir@18522 172 ln -sf ../$(XEN_ROOT)/tools/ioemu/* .)
keir@18522 173 else
keir@18522 174 set -e; \
keir@18522 175 $(absolutify_xen_root); \
keir@18522 176 cd ioemu; \
keir@18522 177 src="$$XEN_ROOT/tools/ioemu-dir"; export src; \
keir@18522 178 (cd $$src && find * -type d -print) | xargs mkdir -p; \
keir@18522 179 (cd $$src && find * ! -type l -type f $(addprefix ! -name , \
keir@18522 180 '*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen \
keir@18522 181 '*.html' '*.pod' \
keir@18522 182 )) | \
keir@18522 183 while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
keir@18522 184 endif
keir@18522 185 touch ioemu/linkfarm.stamp
keir@18522 186
keir@18522 187 mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
keir@18044 188 mkdir -p include/xen && \
keir@18044 189 ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) include/xen && \
keir@18055 190 ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \
keir@18044 191 ( [ -h include/xen/sys ] || ln -sf ../../$(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \
keir@18044 192 mkdir -p include/xen-foreign && \
keir@18044 193 ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*)) include/xen-foreign/ && \
keir@18044 194 $(MAKE) -C include/xen-foreign/ && \
keir@18044 195 ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
keir@18368 196 mkdir -p libxc-$(XEN_TARGET_ARCH)
keir@18368 197 [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
keir@17905 198 ln -sf ../$(XEN_ROOT)/tools/libxc/*.h . && \
keir@17905 199 ln -sf ../$(XEN_ROOT)/tools/libxc/*.c . && \
keir@17905 200 ln -sf ../$(XEN_ROOT)/tools/libxc/Makefile . )
keir@18368 201 mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH)
keir@18368 202 [ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \
keir@17905 203 ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
keir@17905 204 ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
keir@17905 205 ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
keir@17905 206 $(MAKE) -C $(MINI_OS) links
keir@18368 207 touch mk-headers-$(XEN_TARGET_ARCH)
keir@17905 208
keir@18368 209 TARGETS_MINIOS=$(addprefix mini-os-$(XEN_TARGET_ARCH)-,$(TARGETS))
keir@17905 210 $(TARGETS_MINIOS): mini-os-%:
keir@17905 211 [ -d $@ ] || \
keir@17905 212 for i in $$(cd $(MINI_OS) ; find . -type d) ; do \
keir@17905 213 mkdir -p $@/$$i ; \
keir@17905 214 done
keir@17066 215
keir@17066 216 #######
keir@17066 217 # libxc
keir@17066 218 #######
keir@17066 219
keir@17066 220 .PHONY: libxc
keir@18368 221 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
keir@18368 222 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a:: cross-zlib
keir@18368 223 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C libxc-$(XEN_TARGET_ARCH)
keir@17066 224
keir@17066 225 #######
keir@17066 226 # ioemu
keir@17066 227 #######
keir@17066 228
keir@17066 229 .PHONY: ioemu
keir@18126 230 ioemu: cross-zlib cross-libpci libxc
keir@18055 231 ifeq ($(CONFIG_QEMU),ioemu)
keir@17066 232 [ -f ioemu/config-host.mak ] || \
keir@18007 233 ( cd ioemu ; \
keir@18007 234 XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh configure --prefix=/usr --enable-stubdom $(IOEMU_OPTIONS))
keir@18368 235 CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS=
keir@18055 236 else
keir@18055 237 [ -f ioemu/config-host.mak ] || \
keir@18512 238 ( $(absolutify_xen_root); \
keir@18512 239 cd ioemu ; \
keir@18512 240 CONFIG_STUBDOM=yes XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh ./xen-setup --cc=$(CC) --disable-gcc-check $(IOEMU_OPTIONS))
keir@18368 241 CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS= CONFIG_STUBDOM=yes
keir@18055 242 endif
keir@17066 243
keir@17066 244 ######
keir@17066 245 # caml
keir@17066 246 ######
keir@17066 247
keir@17066 248 .PHONY: caml
keir@18127 249 caml: $(CROSS_ROOT)
keir@18368 250 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH)
keir@17066 251
keir@17299 252 ###
keir@17299 253 # C
keir@17299 254 ###
keir@17299 255
keir@17299 256 .PHONY: c
keir@18127 257 c: $(CROSS_ROOT)
keir@18368 258 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH)
keir@17299 259
keir@17909 260 ######
keir@17909 261 # Grub
keir@17909 262 ######
keir@17909 263
keir@18113 264 grub-$(GRUB_VERSION).tar.gz:
keir@18281 265 $(WGET) $(GRUB_URL)/$@
keir@18113 266
keir@18113 267 grub-upstream: grub-$(GRUB_VERSION).tar.gz
keir@18113 268 tar xzf $<
keir@18113 269 mv grub-$(GRUB_VERSION) $@
keir@17909 270 for i in grub.patches/* ; do \
keir@17909 271 patch -d $@ -p1 < $$i ; \
keir@17909 272 done
keir@17909 273
keir@17909 274 .PHONY: grub
keir@18127 275 grub: grub-upstream $(CROSS_ROOT)
keir@18368 276 mkdir -p grub-$(XEN_TARGET_ARCH)
keir@18368 277 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
keir@17909 278
keir@17066 279 ########
keir@17066 280 # minios
keir@17066 281 ########
keir@17066 282
keir@17778 283 .PHONY: ioemu-stubdom
keir@18055 284 ifeq ($(CONFIG_QEMU),ioemu)
keir@18055 285 ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-dm-stubdom/qemu.a $(CURDIR)/ioemu/i386-dm-stubdom/libqemu.a
keir@18055 286 else
keir@18055 287 ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a
keir@18055 288 endif
keir@18368 289 ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc ioemu
keir@18368 290 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)"
keir@17066 291
keir@17778 292 CAMLLIB = $(shell ocamlc -where)
keir@17066 293 .PHONY: caml-stubdom
keir@18368 294 caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc caml
keir@18368 295 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"
keir@17299 296
keir@17299 297 .PHONY: c-stubdom
keir@18368 298 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
keir@18368 299 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
keir@17909 300
keir@17909 301 .PHONY: pv-grub
keir@18368 302 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
keir@18368 303 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
keir@17066 304
keir@17066 305 #########
keir@17066 306 # install
keir@17066 307 #########
keir@17066 308
keir@18034 309 ifeq ($(STUBDOM_SUPPORTED),1)
keir@18282 310 install: install-readme install-ioemu install-grub
keir@18034 311 else
keir@18034 312 install:
keir@18034 313 endif
keir@17909 314
keir@18282 315 install-readme:
keir@18282 316 $(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
keir@18282 317 $(INSTALL_DATA) README $(DESTDIR)$(DOCDIR)/README.stubdom
keir@18282 318
keir@18034 319 install-ioemu: ioemu-stubdom
keir@18034 320 $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/bin"
keir@17066 321 $(INSTALL_PROG) stubdom-dm "$(DESTDIR)/usr/lib/xen/bin"
keir@18034 322 $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
keir@18368 323 $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/ioemu-stubdom.gz"
keir@17909 324
keir@18034 325 install-grub: pv-grub
keir@18034 326 $(INSTALL_DIR) "$(DESTDIR)/usr/lib/xen/boot"
keir@18368 327 $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)/usr/lib/xen/boot/pv-grub-$(XEN_TARGET_ARCH).gz"
keir@17066 328
keir@17066 329 #######
keir@17066 330 # clean
keir@17066 331 #######
keir@17066 332
keir@17066 333 # Only clean the libxc/ioemu/mini-os part
keir@17066 334 .PHONY: clean
keir@17066 335 clean:
keir@18368 336 rm -fr mini-os-$(XEN_TARGET_ARCH)-ioemu
keir@18368 337 rm -fr mini-os-$(XEN_TARGET_ARCH)-c
keir@18368 338 rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
keir@18368 339 rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
keir@17066 340 $(MAKE) -C caml clean
keir@17778 341 $(MAKE) -C c clean
keir@18368 342 rm -fr grub-$(XEN_TARGET_ARCH)
keir@18368 343 [ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) -C libxc-$(XEN_TARGET_ARCH) clean
keir@18510 344 -[ ! -d ioemu ] || $(MAKE) -C ioemu clean
keir@17066 345
keir@17066 346 # clean the cross-compilation result
keir@17066 347 .PHONY: crossclean
keir@17066 348 crossclean: clean
keir@17066 349 rm -fr $(CROSS_ROOT)
keir@18368 350 rm -fr newlib-$(XEN_TARGET_ARCH)
keir@18368 351 rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
keir@18368 352 rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
keir@18368 353 rm -f mk-headers-$(XEN_TARGET_ARCH)
keir@17066 354
keir@17066 355 # clean patched sources
keir@17066 356 .PHONY: patchclean
keir@17066 357 patchclean: crossclean
keir@18034 358 rm -fr newlib-$(NEWLIB_VERSION)
keir@18368 359 rm -fr lwip-$(XEN_TARGET_ARCH)
keir@18113 360 rm -fr grub-upstream
keir@17066 361
keir@17066 362 # clean downloads
keir@17066 363 .PHONY: downloadclean
keir@17066 364 downloadclean: patchclean
keir@18055 365 rm -f newlib-$(NEWLIB_VERSION).tar.gz
keir@17066 366 rm -f zlib-$(ZLIB_VERSION).tar.gz
keir@17066 367 rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
keir@18114 368 rm -f grub-$(GRUB_VERSION).tar.gz
keir@18114 369 rm -f lwip-$(LWIP_VERSION).tar.gz
keir@17066 370
keir@17066 371 .PHONY: distclean
keir@17066 372 distclean: downloadclean