ia64/xen-unstable

changeset 18498:f03b0cc33576

stubdom/ioemu link farm creation fixes

Replace the stubdom/ioemu link farm creation in stubdom/Makefile,
with code which arranges that:
* No symlinks are made for output files - in particular, any
symlinks for .d files would be written through by the compiler
and cause damage to the original tree and other strange
behaviours
* All subdirectories are made as local subdirectories rather than
links
* Any interrupted or half-completed creation of the link farm
leaves the directory in a state where the link farming will be
restarted
* We use make's inherent ability to test for the existence of files
rather than using [ -f ... ] at the start of the rule's commands
* The list of files to be excluded from the link farm can be
easily updated
etc.

This should fix some problems particularly with parallel builds,
or by-hand builds where directories are entered in other than the
usual order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Sep 16 12:44:26 2008 +0100 (2008-09-16)
parents 087b8b29b6b2
children 3eb7a0cfffc2
files stubdom/Makefile
line diff
     1.1 --- a/stubdom/Makefile	Tue Sep 16 11:26:19 2008 +0100
     1.2 +++ b/stubdom/Makefile	Tue Sep 16 12:44:26 2008 +0100
     1.3 @@ -165,7 +165,26 @@ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VER
     1.4  $(XEN_ROOT)/tools/ioemu-dir:
     1.5  	make -C $(XEN_ROOT)/tools ioemu-dir-find
     1.6  
     1.7 -mk-headers-$(XEN_TARGET_ARCH): $(XEN_ROOT)/tools/ioemu-dir
     1.8 +ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir
     1.9 +	mkdir -p ioemu
    1.10 +ifeq ($(CONFIG_QEMU),ioemu)
    1.11 +	[ -h ioemu/Makefile ] || ( cd ioemu && \
    1.12 +	  ln -sf ../$(XEN_ROOT)/tools/ioemu/* .)
    1.13 +else
    1.14 +	set -e;									\
    1.15 +	$(absolutify_xen_root);							\
    1.16 +	cd ioemu;								\
    1.17 +	src="$$XEN_ROOT/tools/ioemu-dir"; export src;				\
    1.18 +	(cd $$src && find * -type d -print) | xargs mkdir -p;			\
    1.19 +	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
    1.20 +			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
    1.21 +			'*.html' '*.pod'					\
    1.22 +			)) |							\
    1.23 +	    while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
    1.24 +endif
    1.25 +	touch ioemu/linkfarm.stamp
    1.26 +
    1.27 +mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp
    1.28  	mkdir -p include/xen && \
    1.29            ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) include/xen && \
    1.30            ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \
    1.31 @@ -184,22 +203,6 @@ mk-headers-$(XEN_TARGET_ARCH): $(XEN_ROO
    1.32  	  ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \
    1.33  	  ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \
    1.34  	  ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . )
    1.35 -	mkdir -p ioemu
    1.36 -ifeq ($(CONFIG_QEMU),ioemu)
    1.37 -	[ -h ioemu/Makefile ] || ( cd ioemu && \
    1.38 -	  ln -sf ../$(XEN_ROOT)/tools/ioemu/* .)
    1.39 -else
    1.40 -	[ -h ioemu/Makefile ] || ( cd ioemu && \
    1.41 -	  ln -sf ../$(XEN_ROOT)/tools/ioemu-dir/* . && \
    1.42 -          rm -fr i386-dm && \
    1.43 -          rm -fr i386-stubdom && \
    1.44 -          mkdir i386-dm && \
    1.45 -          mkdir i386-stubdom && \
    1.46 -	  ln -sf $(CONFIG_QEMU)/i386-dm/* i386-dm/ && \
    1.47 -	  ln -sf $(CONFIG_QEMU)/i386-stubdom/* i386-stubdom/ )
    1.48 -endif
    1.49 -	[ ! -h ioemu/config-host.h ] || rm -f ioemu/config-host.h
    1.50 -	[ ! -h ioemu/config-host.mak ] || rm -f ioemu/config-host.mak
    1.51  	$(MAKE) -C $(MINI_OS) links
    1.52  	touch mk-headers-$(XEN_TARGET_ARCH)
    1.53