aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-24 14:42:34 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-24 14:42:34 +0000
commit6a8e563b068b0582dd0b57fbcbaf2497a8deb8b5 (patch)
treed53b51b03b2ffeb5c7e45cf6d80d9cf85513e622 /Makefile
parent7c649478436c7a4b201e24ea4658de21408303e5 (diff)
downloadxen-6a8e563b068b0582dd0b57fbcbaf2497a8deb8b5.tar.gz
xen-6a8e563b068b0582dd0b57fbcbaf2497a8deb8b5.tar.bz2
xen-6a8e563b068b0582dd0b57fbcbaf2497a8deb8b5.zip
bitkeeper revision 1.1011.1.2 (40dae85aOFSYGQJhY16qVWXzyhadnA)
makefile cleanups
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile62
1 files changed, 32 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index 5ec29e42e3..571d0b23a6 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
INSTALL_DIR ?= $(shell pwd)/install
-SOURCEFORGE_MIRROR = http://heanet.dl.sourceforge.net/sourceforge
+SOURCEFORGE_MIRROR := http://heanet.dl.sourceforge.net/sourceforge
#http://voxel.dl.sourceforge.net/sourceforge/
#http://easynews.dl.sourceforge.net/sourceforge
@@ -25,55 +25,57 @@ dist: all
$(MAKE) linux-xenU
$(MAKE) linux-xen0
-LINUX_VER ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
+LINUX_VER ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | \
+ sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
LINUX_SRC_PATH ?= .:..
-LINUX_SRC_X ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),$(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
+LINUX_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
+ $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
# search for a pristine kernel tar ball, or try downloading one
pristine-linux-src:
-ifneq ($(LINUX_SRC),)
- @[ -r "$(LINUX_SRC)" ] || (echo "Can not find linux src at $(LINUX_SRC)" && false)
-LINUX_SRC_X = $(LINUX_SRC)
-else
-ifeq ($(LINUX_SRC_X),)
- @echo "Can not find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
+ifeq ($(LINUX_SRC),)
+ @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
@wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
-LINUX_SRC_X = ./linux-$(LINUX_VER).tar.bz2
-endif
+LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2
endif
patches/ebtables-brnf-5_vs_2.4.25.diff:
mkdir -p patches
- wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz -O- | gunzip -c > $@
+ wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
+ -O- | gunzip -c > $@
-LINUX_TREES = linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
+LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
# make a linux-xen build tree from a pristine kernel plus sparse tree
mk-linux-trees: patches/ebtables-brnf-5_vs_2.4.25.diff pristine-linux-src
$(RM) -rf $(LINUX_TREES)
-ifeq (,$(findstring bz2,$(LINUX_SRC_X)))
- tar -zxf $(LINUX_SRC_X)
-else
- tar -jxf $(LINUX_SRC_X)
-endif
+ echo $(LINUX_SRC) | grep -q bz2 && \
+ tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
- ( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
+ ( cd linux-$(LINUX_VER)-xen-sparse ; \
+ ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
- (cd linux-$(LINUX_VER)-xen0 && patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff)
+ ( cd linux-$(LINUX_VER)-xen0 ; \
+ patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff )
# configure the specified linux tree
+CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
config-xen%:
- $(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen mrproper
- 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
- $(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen oldconfig
- $(MAKE) -C $(subst config-,linux-$(LINUX_VER)-,$(@)) ARCH=xen dep
+ $(MAKE) -C $(CDIR) ARCH=xen mrproper
+ cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
+ $(CDIR)/.config || \
+ $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
+ $(MAKE) -C $(CDIR) ARCH=xen oldconfig
+ $(MAKE) -C $(CDIR) ARCH=xen dep
# build the specified linux tree
+BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
linux-xen%:
- $(MAKE) -C $(subst linux-,linux-$(LINUX_VER)-,$(@)) ARCH=xen modules
- $(MAKE) -C $(subst linux-,linux-$(LINUX_VER)-,$(@)) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
- $(MAKE) -C $(subst linux-,linux-$(LINUX_VER)-,$(@)) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+ $(MAKE) -C $(BDIR) ARCH=xen modules
+ $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
+ modules_install
+ $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
# build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
# and place them in the install directory. 'make install' should then
@@ -96,7 +98,6 @@ clean: delete-symlinks
mrproper: clean
rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
-
make-symlinks: delete-symlinks
ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
@@ -107,12 +108,13 @@ delete-symlinks:
install-twisted:
wget http://www.twistedmatrix.com/products/get-current.epy
tar -zxf Twisted-*.tar.gz
- (cd Twisted-* ; python setup.py install)
+ ( cd Twisted-* ; python setup.py install )
# handy target to upgrade iptables (use rpm or apt-get in preference)
install-iptables:
wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
tar -jxf iptables-*.tar.bz2
- (cd iptables-* ; make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
+ ( cd iptables-* ; \
+ make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)