ia64/xen-unstable

changeset 2858:9e8025840eed

bitkeeper revision 1.1159.156.1 (4189294bhEVxhbLKBhFfQF071MOltw)

Build system cleanups.
author cl349@freefall.cl.cam.ac.uk
date Wed Nov 03 18:54:03 2004 +0000 (2004-11-03)
parents 42df95ee8ac3
children 23cadd2f9146
files Makefile buildconfigs/Rules.mk buildconfigs/mk.linux-2.4-xen0 buildconfigs/mk.linux-2.4-xenU buildconfigs/mk.linux-2.6-xen0 buildconfigs/mk.linux-2.6-xenU buildconfigs/mk.netbsd-2.0-xenU
line diff
     1.1 --- a/Makefile	Wed Nov 03 14:34:35 2004 +0000
     1.2 +++ b/Makefile	Wed Nov 03 18:54:03 2004 +0000
     1.3 @@ -12,9 +12,13 @@ SOURCEFORGE_MIRROR := http://heanet.dl.s
     1.4  #KERNELS = mk.linux-2.6-xen0 mk.linux-2.6-xenU mk.linux-2.4-xen0 mk.linux-2.4-xenU mk.netbsd-2.0-xenU
     1.5  KERNELS = mk.linux-2.6-xen0 mk.linux-2.6-xenU
     1.6  
     1.7 +ALLKERNELS = $(patsubst buildconfigs/%,%,$(wildcard buildconfigs/mk.*))
     1.8 +ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
     1.9 +
    1.10  export INSTALL_DIR SOURCEFORGE_MIRROR
    1.11  
    1.12 -.PHONY: all dist install xen tools kernels docs kdelete kclean mkpatches world clean mrproper
    1.13 +.PHONY:	all dist install xen tools kernels docs world clean mkpatches mrproper
    1.14 +.PHONY:	kbuild kdelete kclean
    1.15  
    1.16  all: 	dist
    1.17  
    1.18 @@ -49,17 +53,19 @@ docs:
    1.19  	sh ./docs/check_pkgs && \
    1.20  		$(MAKE) prefix=$(INSTALL_DIR) dist=yes -C docs install || true
    1.21  
    1.22 +kbuild: kernels
    1.23 +
    1.24  # Delete the kernel build trees entirely
    1.25  kdelete:
    1.26  	for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i delete ; done
    1.27  
    1.28  # Clean the kernel build trees
    1.29  kclean:
    1.30 -	for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i delete ; done
    1.31 +	for i in $(KERNELS) ; do $(MAKE) -f buildconfigs/$$i clean ; done
    1.32  
    1.33  # Make patches from kernel sparse trees
    1.34  mkpatches:
    1.35 -	$(MAKE) -f buildconfigs/Rules.mk mkpatches
    1.36 +	for i in $(ALLSPARSETREES) ; do $(MAKE) -f buildconfigs/Rules.mk $$i-xen.patch ; done
    1.37  
    1.38  
    1.39  # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
    1.40 @@ -77,9 +83,10 @@ clean:
    1.41  	$(MAKE) -C docs clean
    1.42  
    1.43  # clean, but blow away kernel build tree plus tar balls
    1.44 -mrproper: clean kdelete
    1.45 -	rm -rf dist patches *.tar.bz2 
    1.46 -	$(MAKE) -f buildconfigs/Rules.mk mrproper
    1.47 +mrproper: clean
    1.48 +	rm -rf dist patches
    1.49 +	for i in $(ALLKERNELS) ; do $(MAKE) -f buildconfigs/$$i delete ; done
    1.50 +	for i in $(ALLSPARSETREES) ; do $(MAKE) -f buildconfigs/Rules.mk $$i-mrproper ; done
    1.51  
    1.52  install-twisted:
    1.53  	wget http://www.twistedmatrix.com/products/get-current.epy
     2.1 --- a/buildconfigs/Rules.mk	Wed Nov 03 14:34:35 2004 +0000
     2.2 +++ b/buildconfigs/Rules.mk	Wed Nov 03 18:54:03 2004 +0000
     2.3 @@ -1,80 +1,68 @@
     2.4  
     2.5  # We expect these two to already be set if people 
     2.6  # are using the top-level Makefile
     2.7 -DIST_DIR    ?= $(shell pwd)/dist
     2.8 -INSTALL_DIR ?= $(DIST_DIR)/install
     2.9 +DIST_DIR	?= $(shell pwd)/dist
    2.10 +INSTALL_DIR	?= $(DIST_DIR)/install
    2.11 +
    2.12 +.PHONY:	mkpatches mrproper
    2.13 +
    2.14  
    2.15  
    2.16 -# Figure out which Linux version
    2.17 -LINUX_26VER ?= $(shell ( /bin/ls -ld linux-2.6.*-xen-sparse ) \
    2.18 -		2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
    2.19 -
    2.20 -LINUX_24VER ?= $(shell ( /bin/ls -ld linux-2.4.*-xen-sparse ) \
    2.21 -		2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
    2.22 -
    2.23 -LINUX_SRC_PATH   ?= .:..
    2.24 -
    2.25 -LINUX_26SRC      ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
    2.26 -                    $(wildcard $(dir)/linux-$(LINUX_26VER).tar.*z*)))
    2.27 -
    2.28 -LINUX_24SRC      ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
    2.29 -                    $(wildcard $(dir)/linux-$(LINUX_24VER).tar.*z*)))
    2.30 +# Expand Linux series to Linux version
    2.31 +LINUX_SERIES	?= 2.6
    2.32 +LINUX_VER	?= $(patsubst linux-%-xen-sparse,%,$(wildcard linux-$(LINUX_SERIES)*-xen-sparse))
    2.33  
    2.34 -.PHONY:	mkpatches linux-$(LINUX_24VER)-xen.patch linux-$(LINUX_26VER)-xen.patch mrproper
    2.35 +# Setup Linux search patch
    2.36 +LINUX_SRC_PATH	?= .:..
    2.37 +vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
    2.38  
    2.39 -# search for a pristine kernel tar ball, or try downloading one
    2.40 -linux-$(LINUX_26VER).tar.bz2:
    2.41 -ifeq ($(LINUX_26SRC),)
    2.42 -	echo "Cannot find linux-$(LINUX_26VER).tar.bz2 in path $(LINUX_SRC_PATH)"
    2.43 -	wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-$(LINUX_26VER).tar.bz2 -O./linux-$(LINUX_26VER).tar.bz2
    2.44 -LINUX_26SRC := ./linux-$(LINUX_26VER).tar.bz2 
    2.45 -endif
    2.46 +# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
    2.47 +linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
    2.48 +linux-%.tar.bz2:
    2.49 +	echo "Cannot find linux-$*.tar.bz2 in path $(LINUX_SRC_PATH)"
    2.50 +	wget http://www.kernel.org/pub/linux/kernel/v$(_LINUX_VDIR)/linux-$*.tar.bz2 -O./$@
    2.51  
    2.52 -pristine-linux-$(LINUX_26VER): $(LINUX_26SRC)
    2.53 -	rm -rf tmp-linux-$(LINUX_26VER) $@ && \
    2.54 -	mkdir -p tmp-linux-$(LINUX_26VER) && \
    2.55 -	tar -C tmp-linux-$(LINUX_26VER) -jxf $(LINUX_26SRC) && \
    2.56 -	mv tmp-linux-$(LINUX_26VER)/* $@
    2.57 -	touch $@ # update timestamp to avoid rebuild
    2.58 -	@rm -rf tmp-linux-$(LINUX_26VER)
    2.59  
    2.60  
    2.61 -# search for a pristine kernel tar ball, or try downloading one
    2.62 -linux-$(LINUX_24VER).tar.bz2:
    2.63 -ifeq ($(LINUX_24SRC),)
    2.64 -	echo "Cannot find linux-$(LINUX_24VER).tar.bz2 in path $(LINUX_SRC_PATH)"
    2.65 -	wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_24VER).tar.bz2 -O./linux-$(LINUX_24VER).tar.bz2
    2.66 -LINUX_24SRC := ./linux-$(LINUX_24VER).tar.bz2 
    2.67 -endif
    2.68 +# Expand NetBSD release to NetBSD version
    2.69 +NETBSD_RELEASE  ?= 2.0
    2.70 +NETBSD_VER      ?= $(patsubst netbsd-%-xen-sparse,%,$(wildcard netbsd-$(NETBSD_RELEASE)*-xen-sparse))
    2.71 +NETBSD_CVSSNAP  ?= 20040906
    2.72 +
    2.73 +# Setup NetBSD search patch
    2.74 +NETBSD_SRC_PATH	?= .:..
    2.75 +vpath netbsd-%.tar.bz2 $(NETBSD_SRC_PATH)
    2.76 +
    2.77 +# download a pristine NetBSD tarball if there isn't one in NETBSD_SRC_PATH
    2.78 +netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
    2.79 +	echo "Cannot find $@ in path $(NETBSD_SRC_PATH)"
    2.80 +	wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2 -O./$@
    2.81 +
    2.82 +netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
    2.83 +	ln -fs $< $@
    2.84  
    2.85 -pristine-linux-$(LINUX_24VER): $(LINUX_24SRC)
    2.86 -	rm -rf tmp-linux-$(LINUX_24VER) $@ && \
    2.87 -	mkdir -p tmp-linux-$(LINUX_24VER) && \
    2.88 -	tar -C tmp-linux-$(LINUX_24VER) -jxf $(LINUX_24SRC) && \
    2.89 -	mv tmp-linux-$(LINUX_24VER)/* $@ && \
    2.90 +
    2.91 +
    2.92 +
    2.93 +pristine-%: %.tar.bz2
    2.94 +	rm -rf tmp-$* $@ && \
    2.95 +	  mkdir -p tmp-$* && \
    2.96 +	  tar -C tmp-$* -jxf $< && \
    2.97 +	  mv tmp-$*/* $@
    2.98  	touch $@ # update timestamp to avoid rebuild
    2.99 -	@rm -rf tmp-linux-$(LINUX_24VER)
   2.100 +	@rm -rf tmp-$*
   2.101  
   2.102 -linux-$(LINUX_24VER)-xen.patch: pristine-linux-$(LINUX_24VER)	
   2.103 +%-xen.patch: pristine-%
   2.104  	rm -rf tmp-$@
   2.105 -	cp -al pristine-linux-$(LINUX_24VER) tmp-$@
   2.106 -	( cd linux-$(LINUX_24VER)-xen-sparse ; \
   2.107 -          ./mkbuildtree ../tmp-$@ )	
   2.108 -	diff -Nurp pristine-linux-$(LINUX_24VER) tmp-$@ > $@ || true
   2.109 +	cp -al pristine-$* tmp-$@
   2.110 +	( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )	
   2.111 +	diff -Nurp pristine-$* tmp-$@ > $@ || true
   2.112  	rm -rf tmp-$@
   2.113  
   2.114 -linux-$(LINUX_26VER)-xen.patch: pristine-linux-$(LINUX_26VER)
   2.115 -	rm -rf tmp-$@
   2.116 -	cp -al pristine-linux-$(LINUX_26VER) tmp-$@
   2.117 -	( cd linux-$(LINUX_26VER)-xen-sparse ; \
   2.118 -          ./mkbuildtree ../tmp-$@ )	
   2.119 -	diff -Nurp pristine-linux-$(LINUX_26VER) tmp-$@ > $@ || true
   2.120 -	rm -rf tmp-$@
   2.121 +%-mrproper:
   2.122 +	rm -rf pristine-$* $*.tar.bz2
   2.123 +	rm -rf $*-xen.patch
   2.124 +	rm -rf $*-tools $*-tools.tar.bz2
   2.125  
   2.126 -mkpatches: linux-$(LINUX_24VER)-xen.patch linux-$(LINUX_26VER)-xen.patch
   2.127 -
   2.128 -mrproper:
   2.129 -	rm -rf pristine-linux-$(LINUX_24VER) linux-$(LINUX_24VER).tar.bz2
   2.130 -	rm -rf pristine-linux-$(LINUX_26VER) linux-$(LINUX_26VER).tar.bz2
   2.131 -	rm -rf linux-$(LINUX_24VER)-xen.patch linux-$(LINUX_26VER)-xen.patch
   2.132 -	rm -rf pristine-netbsd-2.0 netbsd-2.0-tools
   2.133 +# never delete any intermediate files.
   2.134 +.SECONDARY:
     3.1 --- a/buildconfigs/mk.linux-2.4-xen0	Wed Nov 03 14:34:35 2004 +0000
     3.2 +++ b/buildconfigs/mk.linux-2.4-xen0	Wed Nov 03 18:54:03 2004 +0000
     3.3 @@ -1,7 +1,9 @@
     3.4 +
     3.5 +LINUX_SERIES = 2.4
     3.6  
     3.7  EXTRAVERSION = xen0
     3.8  
     3.9 -FULLVERSION  = $(LINUX_24VER)-$(EXTRAVERSION)
    3.10 +FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
    3.11  
    3.12  LINUX_DIR    = linux-$(FULLVERSION)
    3.13  
    3.14 @@ -19,11 +21,11 @@ patches/ebtables.diff:
    3.15  	mkdir -p patches
    3.16  	wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@
    3.17  
    3.18 -$(LINUX_DIR):  pristine-linux-$(LINUX_24VER) patches/ebtables.diff
    3.19 +$(LINUX_DIR):  pristine-linux-$(LINUX_VER) patches/ebtables.diff
    3.20  	rm -rf $(LINUX_DIR)
    3.21 -	cp -al pristine-linux-$(LINUX_24VER) $(LINUX_DIR)
    3.22 +	cp -al pristine-linux-$(LINUX_VER) $(LINUX_DIR)
    3.23  	# Apply arch-xen patches
    3.24 -	( cd linux-$(LINUX_24VER)-xen-sparse ; \
    3.25 +	( cd linux-$(LINUX_VER)-xen-sparse ; \
    3.26            ./mkbuildtree ../$(LINUX_DIR) )
    3.27  	# Patch kernel Makefile to set EXTRAVERSION
    3.28  	( cd $(LINUX_DIR) ; \
    3.29 @@ -40,11 +42,4 @@ clean:
    3.30  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    3.31  
    3.32  delete: 
    3.33 -	rm -rf tmp-linux-$(LINUX_24VER) $(LINUX_DIR) 
    3.34 -
    3.35 -
    3.36 -
    3.37 -
    3.38 -
    3.39 -
    3.40 -
    3.41 +	rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
     4.1 --- a/buildconfigs/mk.linux-2.4-xenU	Wed Nov 03 14:34:35 2004 +0000
     4.2 +++ b/buildconfigs/mk.linux-2.4-xenU	Wed Nov 03 18:54:03 2004 +0000
     4.3 @@ -1,7 +1,9 @@
     4.4 +
     4.5 +LINUX_SERIES = 2.4
     4.6  
     4.7  EXTRAVERSION = xenU
     4.8  
     4.9 -FULLVERSION  = $(LINUX_24VER)-$(EXTRAVERSION)
    4.10 +FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
    4.11  
    4.12  LINUX_DIR    = linux-$(FULLVERSION)
    4.13  
    4.14 @@ -19,11 +21,11 @@ patches/ebtables.diff:
    4.15  	mkdir -p patches
    4.16  	wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@
    4.17  
    4.18 -$(LINUX_DIR):  pristine-linux-$(LINUX_24VER) patches/ebtables.diff
    4.19 +$(LINUX_DIR):  pristine-linux-$(LINUX_VER) patches/ebtables.diff
    4.20  	rm -rf $(LINUX_DIR)
    4.21 -	cp -al pristine-linux-$(LINUX_24VER) $(LINUX_DIR)
    4.22 +	cp -al pristine-linux-$(LINUX_VER) $(LINUX_DIR)
    4.23  	# Apply arch-xen patches
    4.24 -	( cd linux-$(LINUX_24VER)-xen-sparse ; \
    4.25 +	( cd linux-$(LINUX_VER)-xen-sparse ; \
    4.26            ./mkbuildtree ../$(LINUX_DIR) )
    4.27  	# Patch kernel Makefile to set EXTRAVERSION
    4.28  	( cd $(LINUX_DIR) ; \
    4.29 @@ -38,11 +40,4 @@ clean:
    4.30  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    4.31  
    4.32  delete: 
    4.33 -	rm -rf tmp-linux-$(LINUX_24VER) $(LINUX_DIR) 
    4.34 -
    4.35 -
    4.36 -
    4.37 -
    4.38 -
    4.39 -
    4.40 -
    4.41 +	rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
     5.1 --- a/buildconfigs/mk.linux-2.6-xen0	Wed Nov 03 14:34:35 2004 +0000
     5.2 +++ b/buildconfigs/mk.linux-2.6-xen0	Wed Nov 03 18:54:03 2004 +0000
     5.3 @@ -1,7 +1,9 @@
     5.4 +
     5.5 +LINUX_SERIES = 2.6
     5.6  
     5.7  EXTRAVERSION = xen0
     5.8  
     5.9 -FULLVERSION  = $(LINUX_26VER)-$(EXTRAVERSION)
    5.10 +FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
    5.11  
    5.12  LINUX_DIR    = linux-$(FULLVERSION)
    5.13  
    5.14 @@ -15,11 +17,11 @@ build: $(LINUX_DIR)
    5.15  	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
    5.16  
    5.17  # The real action starts here!
    5.18 -$(LINUX_DIR):  pristine-linux-$(LINUX_26VER)
    5.19 +$(LINUX_DIR):  pristine-linux-$(LINUX_VER)
    5.20  	rm -rf $(LINUX_DIR)
    5.21 -	cp -al pristine-linux-$(LINUX_26VER) $(LINUX_DIR)
    5.22 +	cp -al pristine-linux-$(LINUX_VER) $(LINUX_DIR)
    5.23  	# Apply arch-xen patches
    5.24 -	( cd linux-$(LINUX_26VER)-xen-sparse ; \
    5.25 +	( cd linux-$(LINUX_VER)-xen-sparse ; \
    5.26            ./mkbuildtree ../$(LINUX_DIR) )
    5.27  	# Patch kernel Makefile to set EXTRAVERSION
    5.28  	( cd $(LINUX_DIR) ; \
    5.29 @@ -33,11 +35,4 @@ clean:
    5.30  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    5.31  
    5.32  delete: 
    5.33 -	rm -rf tmp-linux-$(LINUX_26VER) $(LINUX_DIR) 
    5.34 -
    5.35 -
    5.36 -
    5.37 -
    5.38 -
    5.39 -
    5.40 -
    5.41 +	rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
     6.1 --- a/buildconfigs/mk.linux-2.6-xenU	Wed Nov 03 14:34:35 2004 +0000
     6.2 +++ b/buildconfigs/mk.linux-2.6-xenU	Wed Nov 03 18:54:03 2004 +0000
     6.3 @@ -1,7 +1,9 @@
     6.4 +
     6.5 +LINUX_SERIES = 2.6
     6.6  
     6.7  EXTRAVERSION = xenU
     6.8  
     6.9 -FULLVERSION  = $(LINUX_26VER)-$(EXTRAVERSION)
    6.10 +FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
    6.11  
    6.12  LINUX_DIR    = linux-$(FULLVERSION)
    6.13  
    6.14 @@ -16,11 +18,11 @@ build: $(LINUX_DIR)
    6.15  	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
    6.16  
    6.17  
    6.18 -$(LINUX_DIR):  pristine-linux-$(LINUX_26VER)
    6.19 +$(LINUX_DIR):  pristine-linux-$(LINUX_VER)
    6.20  	rm -rf $(LINUX_DIR)
    6.21 -	cp -al pristine-linux-$(LINUX_26VER) $(LINUX_DIR)
    6.22 +	cp -al pristine-linux-$(LINUX_VER) $(LINUX_DIR)
    6.23  	# Apply arch-xen patches
    6.24 -	( cd linux-$(LINUX_26VER)-xen-sparse ; \
    6.25 +	( cd linux-$(LINUX_VER)-xen-sparse ; \
    6.26            ./mkbuildtree ../$(LINUX_DIR) )
    6.27  	# Patch kernel Makefile to set EXTRAVERSION
    6.28  	( cd $(LINUX_DIR) ; \
    6.29 @@ -34,11 +36,4 @@ clean:
    6.30  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    6.31  
    6.32  delete: 
    6.33 -	rm -rf tmp-linux-$(LINUX_26VER) $(LINUX_DIR) 
    6.34 -
    6.35 -
    6.36 -
    6.37 -
    6.38 -
    6.39 -
    6.40 -
    6.41 +	rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
     7.1 --- a/buildconfigs/mk.netbsd-2.0-xenU	Wed Nov 03 14:34:35 2004 +0000
     7.2 +++ b/buildconfigs/mk.netbsd-2.0-xenU	Wed Nov 03 18:54:03 2004 +0000
     7.3 @@ -1,5 +1,6 @@
     7.4  
     7.5  NETBSD_RELEASE   ?= 2.0
     7.6 +NETBSD_CVSSNAP   ?= 20040906
     7.7  
     7.8  EXTRAVERSION = xenU
     7.9  
    7.10 @@ -11,40 +12,19 @@ NETBSD_DIR   = netbsd-$(FULLVERSION)
    7.11  
    7.12  include buildconfigs/Rules.mk
    7.13  
    7.14 -NETBSD_VER       ?= $(shell ( /bin/ls -ld netbsd-$(NETBSD_RELEASE)*-xen-sparse ) 2>/dev/null | \
    7.15 -		      sed -e 's!^.*netbsd-\(.\+\)-xen-sparse!\1!' )
    7.16 -NETBSD_CVSSNAP   ?= 20040906
    7.17 -NETBSD_SRC_PATH  ?= .:..
    7.18 -NETBSD_SRC       ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
    7.19 -                    $(wildcard $(dir)/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.*z*)))
    7.20 +build: $(NETBSD_DIR) netbsd-$(EXTRAVERSION)
    7.21 +
    7.22  NETBSD_TOOLS_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
    7.23                      $(wildcard $(dir)/netbsd-$(NETBSD_VER)-tools.tar.*z*)))
    7.24  
    7.25 -build: $(NETBSD_DIR) netbsd-$(EXTRAVERSION)
    7.26 -
    7.27 -netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
    7.28 -ifeq ($(NETBSD_SRC),)
    7.29 -	@echo "Cannot find netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.gz in path $(NETBSD_SRC_PATH)"
    7.30 -	@wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2 -O./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
    7.31 -NETBSD_SRC := ./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2 
    7.32 -endif
    7.33 -
    7.34 -pristine-netbsd-$(NETBSD_VER): $(NETBSD_SRC)
    7.35 -	rm -rf tmp-netbsd-$(NETBSD_VER) $@ && \
    7.36 -	mkdir -p tmp-netbsd-$(NETBSD_VER) && \
    7.37 -	tar -C tmp-netbsd-$(NETBSD_VER) -jxf $(NETBSD_SRC) && \
    7.38 -	mv tmp-netbsd-$(NETBSD_VER)/* $@
    7.39 -	touch $@ # update timestamp to avoid rebuild
    7.40 -	@rm -rf tmp-netbsd-$(NETBSD_VER)
    7.41 -
    7.42 -pristine-netbsd-tools-src: 
    7.43 +netbsd-tools-src: 
    7.44  ifeq ($(NETBSD_TOOLS_SRC),)
    7.45  	@echo "Cannot find netbsd-$(NETBSD_VER)-tools.tar.gz in path $(NETBSD_SRC_PATH)"
    7.46  	@wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-tools.tar.bz2 -O./netbsd-$(NETBSD_VER)-tools.tar.bz2
    7.47  NETBSD_TOOLS_SRC := ./netbsd-$(NETBSD_VER)-tools.tar.bz2 
    7.48  endif
    7.49  
    7.50 -netbsd-tools: pristine-netbsd-tools-src
    7.51 +netbsd-tools: netbsd-tools-src
    7.52  	@[ -d netbsd-$(NETBSD_RELEASE)-tools ] || { \
    7.53  		echo extract $(NETBSD_TOOLS_SRC); \
    7.54  		tar -jxf $(NETBSD_TOOLS_SRC); }
    7.55 @@ -60,7 +40,7 @@ netbsd-tools: pristine-netbsd-tools-src
    7.56  netbsd-xen%:	
    7.57  	$(MAKE) -C netbsd-$(FULLVERSION) config
    7.58  	$(MAKE) -C netbsd-$(FULLVERSION) netbsd
    7.59 -	$(MAKE) -C netbsd-$(FULLVERSION) INSTALL_PATH=$(INSTALL_DIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-$(subst netbsd-,,$@) install
    7.60 +	$(MAKE) -C netbsd-$(FULLVERSION) INSTALL_PATH=$(INSTALL_DIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-xen$* install
    7.61  
    7.62  clean:
    7.63  	$(MAKE) -C netbsd-$(FULLVERSION) clean