debuggers.hg

annotate stubdom/Makefile @ 19878:e94691561b48

stubdom: use XENFIRMWAREDIR

Attached patch installs ioemu-stubdom into XENFIRMWAREDIR
analogous to what we do with hvmloader.

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