debuggers.hg

annotate stubdom/Makefile @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents de125ae8415d
children
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@19661 30 #OCAML_URL?=$(XEN_EXTFILES_URL)
keir@19661 31 OCAML_URL?=http://caml.inria.fr/pub/distrib/ocaml-3.11
keir@19661 32 OCAML_VERSION=3.11.0
keir@19661 33
keir@17066 34 WGET=wget -c
keir@17066 35
keir@17066 36 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
keir@17066 37 ifeq ($(XEN_TARGET_ARCH),x86_32)
keir@17066 38 GNU_TARGET_ARCH:=i686
keir@17066 39 endif
keir@17066 40
keir@17066 41 ifeq ($(GNU_TARGET_ARCH), i686)
keir@17066 42 TARGET_CFLAGS=
keir@17830 43 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
keir@18034 44 STUBDOM_SUPPORTED=1
keir@17066 45 endif
keir@17066 46 ifeq ($(GNU_TARGET_ARCH), x86_64)
keir@17066 47 TARGET_CFLAGS=-mno-red-zone
keir@17830 48 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
keir@18034 49 STUBDOM_SUPPORTED=1
keir@17066 50 endif
keir@17066 51 ifeq ($(GNU_TARGET_ARCH), ia64)
keir@17066 52 TARGET_CFLAGS=-mconstant-gp
keir@17066 53 endif
keir@17066 54
keir@17066 55 CROSS_ROOT=cross-root-$(GNU_TARGET_ARCH)
keir@17066 56 CROSS_PREFIX=$(CURDIR)/$(CROSS_ROOT)
keir@18007 57
keir@18007 58 # Disable PIE/SSP if GCC supports them. They can break us.
keir@18007 59 TARGET_CFLAGS += $(CFLAGS)
keir@18007 60 TARGET_CPPFLAGS += $(CPPFLAGS)
keir@21906 61 $(call cc-options-add,TARGET_CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
keir@18007 62
keir@18007 63 # Do not use host headers and libs
keir@18430 64 GCC_INSTALL = $(shell LANG=C gcc -print-search-dirs | sed -n -e 's/install: \(.*\)/\1/p')
keir@18007 65 TARGET_CPPFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__
keir@18055 66 TARGET_CPPFLAGS += -nostdinc
keir@18069 67 TARGET_CPPFLAGS += -isystem $(CURDIR)/$(MINI_OS)/include/posix
keir@18007 68 TARGET_CPPFLAGS += -isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include
keir@18007 69 TARGET_CPPFLAGS += -isystem $(GCC_INSTALL)include
keir@18510 70 TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-$(XEN_TARGET_ARCH)/src/include
keir@18510 71 TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-$(XEN_TARGET_ARCH)/src/include/ipv4
keir@18044 72 TARGET_CPPFLAGS += -I$(CURDIR)/include
keir@20085 73 TARGET_CPPFLAGS += -I$(XEN_ROOT)/xen/include
keir@18007 74
keir@18007 75 TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
keir@17066 76
keir@17909 77 TARGETS=ioemu c caml grub
keir@17905 78
ian@21887 79 CROSS_MAKE := $(MAKE) DESTDIR=
keir@19856 80
keir@17066 81 .PHONY: all
keir@19972 82 all: build
keir@18034 83 ifeq ($(STUBDOM_SUPPORTED),1)
keir@19972 84 build: genpath ioemu-stubdom c-stubdom pv-grub
keir@18034 85 else
keir@19972 86 build: genpath
keir@18034 87 endif
keir@17066 88
ian@21887 89 STUBDOMPATH="stubdompath.sh"
ian@21887 90 genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
ian@21887 91 $(eval $(genpath-target))
ian@21887 92
keir@17066 93 ##############
keir@17066 94 # Cross-newlib
keir@17066 95 ##############
keir@17066 96
keir@18034 97 newlib-$(NEWLIB_VERSION).tar.gz:
keir@18281 98 $(WGET) $(NEWLIB_URL)/$@
keir@18034 99
keir@18034 100 newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
keir@18034 101 tar xzf $<
keir@17905 102 patch -d $@ -p0 < newlib.patch
keir@19490 103 patch -d $@ -p0 < newlib-chk.patch
keir@20161 104 patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
keir@21525 105 find $@ -type f | xargs perl -i.bak \
keir@21525 106 -pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
keir@18034 107 touch $@
keir@17066 108
keir@17066 109 NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a
keir@17066 110 .PHONY: cross-newlib
keir@17066 111 cross-newlib: $(NEWLIB_STAMPFILE)
keir@18368 112 $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
keir@18368 113 mkdir -p newlib-$(XEN_TARGET_ARCH)
keir@18368 114 ( cd newlib-$(XEN_TARGET_ARCH) && \
keir@18034 115 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 && \
ian@21887 116 $(CROSS_MAKE) && \
ian@21887 117 $(CROSS_MAKE) install )
keir@17066 118
keir@17066 119 ############
keir@17066 120 # Cross-zlib
keir@17066 121 ############
keir@17066 122
keir@17066 123 zlib-$(ZLIB_VERSION).tar.gz:
keir@18281 124 $(WGET) $(ZLIB_URL)/$@
keir@17066 125
keir@18368 126 zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz
keir@18368 127 tar xzf $<
keir@18368 128 mv zlib-$(ZLIB_VERSION) $@
keir@18368 129
keir@17066 130 ZLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libz.a
keir@17066 131 .PHONY: cross-zlib
keir@17066 132 cross-zlib: $(ZLIB_STAMPFILE)
keir@18368 133 $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
keir@18368 134 ( cd $< && \
keir@18007 135 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
ian@21887 136 $(CROSS_MAKE) libz.a && \
ian@21887 137 $(CROSS_MAKE) install )
keir@17066 138
keir@17066 139 ##############
keir@17066 140 # Cross-libpci
keir@17066 141 ##############
keir@17066 142
keir@17066 143 pciutils-$(LIBPCI_VERSION).tar.bz2:
keir@18281 144 $(WGET) $(LIBPCI_URL)/$@
keir@17066 145
keir@18368 146 pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
keir@17984 147 tar xjf $<
keir@18368 148 mv pciutils-$(LIBPCI_VERSION) $@
keir@17984 149 patch -d $@ -p1 < pciutils.patch
keir@17984 150 touch $@
keir@17984 151
keir@17066 152 LIBPCI_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libpci.a
keir@17066 153 .PHONY: cross-libpci
keir@17066 154 cross-libpci: $(LIBPCI_STAMPFILE)
keir@18368 155 $(LIBPCI_STAMPFILE): pciutils-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) $(ZLIB_STAMPFILE)
keir@18368 156 ( cd $< && \
keir@17066 157 cp ../libpci.config.h lib/config.h && \
jbeulich@22459 158 chmod u+w lib/config.h && \
keir@17066 159 echo '#define PCILIB_VERSION "$(LIBPCI_VERSION)"' >> lib/config.h && \
jbeulich@22459 160 ln -sf ../../libpci.config.mak lib/config.mk && \
ian@21887 161 $(CROSS_MAKE) CC="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -I$(realpath $(MINI_OS)/include)" lib/libpci.a && \
keir@17066 162 $(INSTALL_DATA) lib/libpci.a $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ && \
keir@17066 163 $(INSTALL_DIR) $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/pci && \
keir@18259 164 $(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 165 )
keir@17066 166
keir@17066 167 ######
keir@17066 168 # lwIP
keir@17066 169 ######
keir@17066 170
keir@18114 171 lwip-$(LWIP_VERSION).tar.gz:
keir@18281 172 $(WGET) $(LWIP_URL)/$@
keir@18114 173
keir@18368 174 lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
keir@18114 175 tar xzf $<
keir@18368 176 mv lwip $@
keir@18114 177 patch -d $@ -p0 < lwip.patch-cvs
keir@18114 178 touch $@
keir@17066 179
keir@19661 180 #############
keir@19661 181 # Cross-ocaml
keir@19661 182 #############
keir@19661 183
keir@19661 184 CAMLLIB = $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/ocaml
keir@19661 185 OCAML_STAMPFILE=$(CAMLLIB)/.dirstamp
keir@19661 186
keir@19661 187 ocaml-$(OCAML_VERSION).tar.gz:
keir@19661 188 $(WGET) $(OCAML_URL)/$@
keir@19661 189
keir@19661 190 ocaml-$(XEN_TARGET_ARCH)/.dirstamp: ocaml-$(OCAML_VERSION).tar.gz ocaml.patch
keir@19661 191 tar xzf $<
keir@19661 192 cd ocaml-$(OCAML_VERSION) && patch -p0 < ../ocaml.patch
keir@19661 193 rm -rf ocaml-$(XEN_TARGET_ARCH)
keir@19661 194 mv ocaml-$(OCAML_VERSION) ocaml-$(XEN_TARGET_ARCH)
keir@19661 195 touch $@
keir@19661 196
keir@19661 197 MINIOS_HASNOT=IPV6 INET_ATON
keir@19661 198
keir@19661 199 .PHONY: cross-ocaml
keir@19661 200 cross-ocaml: $(OCAML_STAMPFILE)
keir@19661 201 $(OCAML_STAMPFILE): ocaml-$(XEN_TARGET_ARCH)/.dirstamp
keir@19661 202 cd ocaml-$(XEN_TARGET_ARCH) && ./configure -prefix $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf \
keir@19661 203 -no-pthread -no-shared-libs -no-tk -no-curses \
pjcolp@22369 204 -cc "$(CC) -U_FORTIFY_SOURCE -fno-stack-protector -mno-red-zone"
keir@19661 205 $(foreach i,$(MINIOS_HASNOT),sed -i 's,^\(#define HAS_$(i)\),//\1,' ocaml-$(XEN_TARGET_ARCH)/config/s.h ; )
ian@21887 206 $(CROSS_MAKE) -C ocaml-$(XEN_TARGET_ARCH) world
ian@21887 207 $(CROSS_MAKE) -C ocaml-$(XEN_TARGET_ARCH) opt
keir@19661 208 $(MAKE) -C ocaml-$(XEN_TARGET_ARCH) install
keir@19661 209 touch $@
keir@19661 210
keir@17066 211 #######
keir@17066 212 # Links
keir@17066 213 #######
keir@17066 214
keir@17066 215 .PHONY: $(CROSS_ROOT)
keir@17066 216 $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
keir@17066 217
Ian@22466 218 QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
Ian@22466 219
Ian@22466 220 ifeq ($(QEMU_ROOT),.)
keir@18510 221 $(XEN_ROOT)/tools/ioemu-dir:
ian@21887 222 $(CROSS_MAKE) -C $(XEN_ROOT)/tools ioemu-dir-find
keir@18510 223
keir@18522 224 ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir
keir@18522 225 mkdir -p ioemu
keir@18522 226 set -e; \
keir@18522 227 $(absolutify_xen_root); \
keir@18522 228 cd ioemu; \
keir@18522 229 src="$$XEN_ROOT/tools/ioemu-dir"; export src; \
keir@18522 230 (cd $$src && find * -type d -print) | xargs mkdir -p; \
keir@18522 231 (cd $$src && find * ! -type l -type f $(addprefix ! -name , \
keir@18522 232 '*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen \
keir@18522 233 '*.html' '*.pod' \
keir@18522 234 )) | \
keir@18522 235 while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
keir@18522 236 touch ioemu/linkfarm.stamp
Ian@22466 237 else
Ian@22466 238 export QEMU_ROOT
Ian@22466 239
Ian@22466 240 ioemu/linkfarm.stamp:
Ian@22466 241 mkdir -p ioemu
Ian@22466 242 touch ioemu/linkfarm.stamp
Ian@22466 243 endif
keir@18522 244
keir@18522 245 mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
keir@18044 246 mkdir -p include/xen && \
keir@18044 247 ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) include/xen && \
keir@18055 248 ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \
keir@18044 249 ( [ -h include/xen/sys ] || ln -sf ../../$(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \
keir@19062 250 ( [ -h include/xen/libelf ] || ln -sf ../../$(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \
keir@18044 251 mkdir -p include/xen-foreign && \
keir@18044 252 ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*)) include/xen-foreign/ && \
ian@21887 253 $(CROSS_MAKE) -C include/xen-foreign/ && \
keir@18044 254 ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
keir@18368 255 mkdir -p libxc-$(XEN_TARGET_ARCH)
keir@18368 256 [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
keir@17905 257 ln -sf ../$(XEN_ROOT)/tools/libxc/*.h . && \
keir@17905 258 ln -sf ../$(XEN_ROOT)/tools/libxc/*.c . && \
keir@17905 259 ln -sf ../$(XEN_ROOT)/tools/libxc/Makefile . )
keir@18368 260 mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH)
keir@18368 261 [ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \
keir@17905 262 ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
keir@17905 263 ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
keir@17905 264 ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
ian@21887 265 $(CROSS_MAKE) -C $(MINI_OS) links
keir@18368 266 touch mk-headers-$(XEN_TARGET_ARCH)
keir@17905 267
keir@18368 268 TARGETS_MINIOS=$(addprefix mini-os-$(XEN_TARGET_ARCH)-,$(TARGETS))
keir@17905 269 $(TARGETS_MINIOS): mini-os-%:
keir@17905 270 [ -d $@ ] || \
keir@17905 271 for i in $$(cd $(MINI_OS) ; find . -type d) ; do \
keir@17905 272 mkdir -p $@/$$i ; \
keir@17905 273 done
keir@17066 274
keir@17066 275 #######
keir@17066 276 # libxc
keir@17066 277 #######
keir@17066 278
keir@17066 279 .PHONY: libxc
keir@18368 280 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
keir@21049 281 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
ian@21887 282 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C libxc-$(XEN_TARGET_ARCH)
keir@17066 283
keir@21049 284 libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
keir@21049 285
keir@17066 286 #######
keir@17066 287 # ioemu
keir@17066 288 #######
keir@17066 289
keir@17066 290 .PHONY: ioemu
keir@18126 291 ioemu: cross-zlib cross-libpci libxc
keir@18055 292 [ -f ioemu/config-host.mak ] || \
keir@18512 293 ( $(absolutify_xen_root); \
keir@19856 294 $(buildmakevars2shellvars); \
keir@18512 295 cd ioemu ; \
keir@19427 296 LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) \
keir@19427 297 TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
keir@19427 298 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
keir@19427 299 TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
Ian@22466 300 $(QEMU_ROOT)/xen-setup-stubdom )
Ian@22466 301 $(CROSS_MAKE) -C ioemu -f $(QEMU_ROOT)/Makefile
keir@17066 302
keir@17066 303 ######
keir@17066 304 # caml
keir@17066 305 ######
keir@17066 306
keir@17066 307 .PHONY: caml
keir@18127 308 caml: $(CROSS_ROOT)
ian@21887 309 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) OCAMLC_CROSS_PREFIX=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/bin/
keir@17066 310
keir@17299 311 ###
keir@17299 312 # C
keir@17299 313 ###
keir@17299 314
keir@17299 315 .PHONY: c
keir@18127 316 c: $(CROSS_ROOT)
ian@21887 317 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH)
keir@17299 318
keir@17909 319 ######
keir@17909 320 # Grub
keir@17909 321 ######
keir@17909 322
keir@18113 323 grub-$(GRUB_VERSION).tar.gz:
keir@18281 324 $(WGET) $(GRUB_URL)/$@
keir@18113 325
keir@18113 326 grub-upstream: grub-$(GRUB_VERSION).tar.gz
keir@18113 327 tar xzf $<
keir@18113 328 mv grub-$(GRUB_VERSION) $@
keir@17909 329 for i in grub.patches/* ; do \
keir@17909 330 patch -d $@ -p1 < $$i ; \
keir@17909 331 done
keir@17909 332
keir@17909 333 .PHONY: grub
keir@18127 334 grub: grub-upstream $(CROSS_ROOT)
keir@18368 335 mkdir -p grub-$(XEN_TARGET_ARCH)
ian@21887 336 CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(CROSS_MAKE) -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
keir@17909 337
keir@17066 338 ########
keir@17066 339 # minios
keir@17066 340 ########
keir@17066 341
keir@17778 342 .PHONY: ioemu-stubdom
keir@18055 343 ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a
keir@18368 344 ioemu-stubdom: mini-os-$(XEN_TARGET_ARCH)-ioemu lwip-$(XEN_TARGET_ARCH) libxc ioemu
ian@21887 345 DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS="$(APP_OBJS)"
keir@17066 346
keir@17066 347 .PHONY: caml-stubdom
pjcolp@22238 348 caml-stubdom: mini-os-$(XEN_TARGET_ARCH)-caml lwip-$(XEN_TARGET_ARCH) libxc cross-ocaml caml
ian@21887 349 DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_CAML $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(CROSS_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 350
keir@17299 351 .PHONY: c-stubdom
keir@18368 352 c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxc c
ian@21887 353 DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_C $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
keir@17909 354
keir@17909 355 .PHONY: pv-grub
keir@18368 356 pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxc grub
ian@21887 357 DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_GRUB $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(CROSS_MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
keir@17066 358
keir@17066 359 #########
keir@17066 360 # install
keir@17066 361 #########
keir@17066 362
keir@18034 363 ifeq ($(STUBDOM_SUPPORTED),1)
keir@19972 364 install: genpath install-readme install-ioemu install-grub
keir@18034 365 else
keir@19972 366 install: genpath
keir@18034 367 endif
keir@17909 368
keir@18282 369 install-readme:
keir@18282 370 $(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
keir@18282 371 $(INSTALL_DATA) README $(DESTDIR)$(DOCDIR)/README.stubdom
keir@18282 372
keir@18034 373 install-ioemu: ioemu-stubdom
keir@19437 374 $(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)"
keir@19972 375 $(INSTALL_PROG) stubdompath.sh stubdom-dm "$(DESTDIR)$(LIBEXEC)"
keir@19878 376 $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
keir@19878 377 $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
keir@17909 378
keir@18034 379 install-grub: pv-grub
keir@19878 380 $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
keir@19878 381 $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
keir@17066 382
keir@17066 383 #######
keir@17066 384 # clean
keir@17066 385 #######
keir@17066 386
keir@17066 387 # Only clean the libxc/ioemu/mini-os part
keir@17066 388 .PHONY: clean
keir@17066 389 clean:
keir@18368 390 rm -fr mini-os-$(XEN_TARGET_ARCH)-ioemu
keir@18368 391 rm -fr mini-os-$(XEN_TARGET_ARCH)-c
keir@18368 392 rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
keir@18368 393 rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
ian@21887 394 $(CROSS_MAKE) -C caml clean
ian@21887 395 $(CROSS_MAKE) -C c clean
keir@18368 396 rm -fr grub-$(XEN_TARGET_ARCH)
keir@19856 397 rm -f $(STUBDOMPATH)
ian@21887 398 [ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(CROSS_MAKE) -C libxc-$(XEN_TARGET_ARCH) clean
ian@21887 399 -[ ! -d ioemu ] || $(CROSS_MAKE) -C ioemu clean
keir@17066 400
keir@17066 401 # clean the cross-compilation result
keir@17066 402 .PHONY: crossclean
keir@17066 403 crossclean: clean
keir@17066 404 rm -fr $(CROSS_ROOT)
keir@18368 405 rm -fr newlib-$(XEN_TARGET_ARCH)
keir@18368 406 rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
keir@18368 407 rm -fr libxc-$(XEN_TARGET_ARCH) ioemu
keir@18368 408 rm -f mk-headers-$(XEN_TARGET_ARCH)
keir@19661 409 rm -fr ocaml-$(XEN_TARGET_ARCH)
keir@19979 410 rm -fr include
keir@17066 411
keir@17066 412 # clean patched sources
keir@17066 413 .PHONY: patchclean
keir@17066 414 patchclean: crossclean
keir@18034 415 rm -fr newlib-$(NEWLIB_VERSION)
keir@18368 416 rm -fr lwip-$(XEN_TARGET_ARCH)
keir@18113 417 rm -fr grub-upstream
keir@17066 418
keir@17066 419 # clean downloads
keir@17066 420 .PHONY: downloadclean
keir@17066 421 downloadclean: patchclean
keir@18055 422 rm -f newlib-$(NEWLIB_VERSION).tar.gz
keir@17066 423 rm -f zlib-$(ZLIB_VERSION).tar.gz
keir@17066 424 rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
keir@18114 425 rm -f grub-$(GRUB_VERSION).tar.gz
keir@18114 426 rm -f lwip-$(LWIP_VERSION).tar.gz
keir@19661 427 rm -f ocaml-$(OCAML_VERSION).tar.gz
keir@17066 428
keir@17066 429 .PHONY: distclean
keir@17066 430 distclean: downloadclean