debuggers.hg

annotate stubdom/Makefile @ 19490:6ad2b1ded12f

minios: _chk_fail and _chk canaries for minios and newlib

Add __stack_chk_fail to mini-os and __sprintf_chk __fprintf_chk to
newlib, to cope with ocaml runtimes compiled with -fstack-protector.

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