ia64/xen-unstable

changeset 1565:f027c0742a03

bitkeeper revision 1.1011.1.2 (40dae85aOFSYGQJhY16qVWXzyhadnA)

makefile cleanups
author kaf24@scramble.cl.cam.ac.uk
date Thu Jun 24 14:42:34 2004 +0000 (2004-06-24)
parents 46d2220a5d07
children f8a6be024808
files Makefile linux-2.4.26-xen-sparse/arch/xen/Makefile
line diff
     1.1 --- a/Makefile	Thu Jun 24 12:00:50 2004 +0000
     1.2 +++ b/Makefile	Thu Jun 24 14:42:34 2004 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4  
     1.5  INSTALL_DIR ?= $(shell pwd)/install
     1.6  
     1.7 -SOURCEFORGE_MIRROR = http://heanet.dl.sourceforge.net/sourceforge
     1.8 +SOURCEFORGE_MIRROR := http://heanet.dl.sourceforge.net/sourceforge
     1.9  #http://voxel.dl.sourceforge.net/sourceforge/
    1.10  #http://easynews.dl.sourceforge.net/sourceforge
    1.11  
    1.12 @@ -25,55 +25,57 @@ dist: all
    1.13  	$(MAKE) linux-xenU
    1.14  	$(MAKE) linux-xen0
    1.15  
    1.16 -LINUX_VER        ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
    1.17 +LINUX_VER        ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | \
    1.18 +                    sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
    1.19  LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
    1.20  LINUX_SRC_PATH   ?= .:..
    1.21 -LINUX_SRC_X ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),$(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
    1.22 +LINUX_SRC        ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
    1.23 +                    $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
    1.24  
    1.25  # search for a pristine kernel tar ball, or try downloading one
    1.26  pristine-linux-src: 
    1.27 -ifneq ($(LINUX_SRC),)
    1.28 -	@[ -r "$(LINUX_SRC)" ] || (echo "Can not find linux src at $(LINUX_SRC)" && false)
    1.29 -LINUX_SRC_X = $(LINUX_SRC)
    1.30 -else 
    1.31 -ifeq ($(LINUX_SRC_X),)
    1.32 -	@echo "Can not find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
    1.33 +ifeq ($(LINUX_SRC),)
    1.34 +	@echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
    1.35  	@wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
    1.36 -LINUX_SRC_X = ./linux-$(LINUX_VER).tar.bz2 
    1.37 -endif
    1.38 +LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2 
    1.39  endif
    1.40  
    1.41  patches/ebtables-brnf-5_vs_2.4.25.diff:
    1.42  	mkdir -p patches
    1.43 -	wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz -O- | gunzip -c > $@
    1.44 +	wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
    1.45 +	     -O- | gunzip -c > $@
    1.46  
    1.47 -LINUX_TREES = linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
    1.48 +LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
    1.49  
    1.50  # make a linux-xen build tree from a pristine kernel plus sparse tree
    1.51  mk-linux-trees: patches/ebtables-brnf-5_vs_2.4.25.diff pristine-linux-src 
    1.52  	$(RM) -rf $(LINUX_TREES)
    1.53 -ifeq (,$(findstring bz2,$(LINUX_SRC_X)))
    1.54 -	tar -zxf $(LINUX_SRC_X)
    1.55 -else
    1.56 -	tar -jxf $(LINUX_SRC_X)
    1.57 -endif
    1.58 +	echo $(LINUX_SRC) | grep -q bz2 && \
    1.59 +	    tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
    1.60  	mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
    1.61 -	( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
    1.62 +	( cd linux-$(LINUX_VER)-xen-sparse ; \
    1.63 +          ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
    1.64  	cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
    1.65 -	(cd linux-$(LINUX_VER)-xen0 && patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff)
    1.66 +	( cd linux-$(LINUX_VER)-xen0 ; \
    1.67 +          patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff )
    1.68  
    1.69  # configure the specified linux tree
    1.70 +CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
    1.71  config-xen%:
    1.72 -	$(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen mrproper
    1.73 -	cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$(@)) $(subst config-,linux-$(LINUX_VER)-,$(@))/.config || $(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen $(subst config-,,$(@))_config
    1.74 -	$(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen oldconfig
    1.75 -	$(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen dep
    1.76 +	$(MAKE) -C $(CDIR) ARCH=xen mrproper
    1.77 +	cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
    1.78 +	    $(CDIR)/.config || \
    1.79 +	    $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
    1.80 +	$(MAKE) -C $(CDIR) ARCH=xen oldconfig
    1.81 +	$(MAKE) -C $(CDIR) ARCH=xen dep
    1.82  
    1.83  # build the specified linux tree
    1.84 +BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
    1.85  linux-xen%:	
    1.86 -	$(MAKE) -C $(subst linux-,linux-$(LINUX_VER)-,$(@)) ARCH=xen modules
    1.87 -	$(MAKE) -C $(subst linux-,linux-$(LINUX_VER)-,$(@)) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
    1.88 -	$(MAKE) -C $(subst linux-,linux-$(LINUX_VER)-,$(@)) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install	
    1.89 +	$(MAKE) -C $(BDIR) ARCH=xen modules
    1.90 +	$(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
    1.91 +	    modules_install
    1.92 +	$(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
    1.93  
    1.94  # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
    1.95  # and place them in the install directory. 'make install' should then
    1.96 @@ -96,7 +98,6 @@ clean: delete-symlinks
    1.97  mrproper: clean
    1.98  	rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
    1.99  
   1.100 -
   1.101  make-symlinks: delete-symlinks
   1.102  	ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
   1.103  
   1.104 @@ -107,12 +108,13 @@ delete-symlinks:
   1.105  install-twisted:
   1.106  	wget http://www.twistedmatrix.com/products/get-current.epy
   1.107  	tar -zxf Twisted-*.tar.gz
   1.108 -	(cd Twisted-* ; python setup.py install)
   1.109 +	( cd Twisted-* ; python setup.py install )
   1.110  
   1.111  # handy target to upgrade iptables (use rpm or apt-get in preference)
   1.112  install-iptables:
   1.113  	wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
   1.114  	tar -jxf iptables-*.tar.bz2
   1.115 -	(cd iptables-* ; make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
   1.116 +	( cd iptables-* ; \
   1.117 +	  make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
   1.118  
   1.119  
     2.1 --- a/linux-2.4.26-xen-sparse/arch/xen/Makefile	Thu Jun 24 12:00:50 2004 +0000
     2.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/Makefile	Thu Jun 24 14:42:34 2004 +0000
     2.3 @@ -16,15 +16,11 @@
     2.4  #           Added '-march' and '-mpreferred-stack-boundary' support
     2.5  #
     2.6  
     2.7 -override EXTRAVERSION := $(subst linux-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL),,$(shell basename $(TOPDIR)))$(EXTRAVERSION)
     2.8 +override EXTRAVERSION:=$(subst linux-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL),,$(shell basename $(TOPDIR)))$(EXTRAVERSION)
     2.9  
    2.10 -# This following is pretty horrid, but I think the ends justify the
    2.11 -# means: if no .config file exists copy the appropriate defconfig-XXX
    2.12 -# file to .config so that we use it in preference to the plain
    2.13 -# defconfig file. It would be much better if there was a hook in the
    2.14 -# main Makefile to do this, but this works.
    2.15 +# If no .config file exists then use the appropriate defconfig-* file
    2.16  ifneq (.config,$(wildcard .config))
    2.17 -X=$(shell cp arch/xen/defconfig$(EXTRAVERSION) .config)
    2.18 +X:=$(shell cp arch/xen/defconfig$(EXTRAVERSION) .config 2>/dev/null)
    2.19  -include .config
    2.20  endif
    2.21