ia64/xen-unstable

annotate stubdom/Makefile @ 19818:415505139333

Get rid of hardcoded pathes for stubdom and hotplug scripts

- Have the buid system generate a file which exports the install paths
for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
macro
in Config.mk to avoid maintenance of three duplicates each with its
own
tweaks and bugs
- Export gmake variables into ioemu as shell variables
for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
install directory
- Adjust stubdom-dm to use the install directories

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