ia64/xen-unstable

annotate stubdom/Makefile @ 19734:4fb8a6c993e2

VT-d: correct way to submit command to GCMD register

Per VT-d spec, software should submit only one "incremental" command
at a time to Global Command reigster. Current implementation uses a
variable (gcmd) to record the state of Global Status register. It's
error prone.

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