aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-06-24 10:27:08 +0000
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>2004-06-24 10:27:08 +0000
commitf2593c2a9c09d6af8375d8b6fb7cc0a17eac9e05 (patch)
tree4954c8bf894a733c01cc70553e8155264af8b843 /Makefile
parent029d971c4ebc065506b8ba496a48a37770186cc4 (diff)
downloadxen-f2593c2a9c09d6af8375d8b6fb7cc0a17eac9e05.tar.gz
xen-f2593c2a9c09d6af8375d8b6fb7cc0a17eac9e05.tar.bz2
xen-f2593c2a9c09d6af8375d8b6fb7cc0a17eac9e05.zip
bitkeeper revision 1.1003.1.1 (40daac7c6-RMqdy1PiSH_fSWwxWf9A)
master Makefile modified to build each the dom0 and unprivileged xenlinux kernels in different build trees. Also, the "-xen[0U]" tag is reflected in the kernel version name. This means that different modules will need to be built for each, which is less convenient for an expert, but probably less confusing for most users.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile103
1 files changed, 62 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index d4eb93dcd3..5ec29e42e3 100644
--- a/Makefile
+++ b/Makefile
@@ -4,13 +4,17 @@
INSTALL_DIR ?= $(shell pwd)/install
+SOURCEFORGE_MIRROR = http://heanet.dl.sourceforge.net/sourceforge
+#http://voxel.dl.sourceforge.net/sourceforge/
+#http://easynews.dl.sourceforge.net/sourceforge
+
# a not partcularly useful but safe default target
all: make-symlinks
- $(MAKE) -C xen
- $(MAKE) -C tools
+ $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
+ $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
# install everything into the standard system directories
-install: all
+install: dist
$(MAKE) -C xen install
$(MAKE) -C tools install
$(shell cp -a install/boot/*$(LINUX_VER)* /boot/)
@@ -18,13 +22,13 @@ install: all
# install xen and tools into the install directory
dist: all
- $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
- $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
+ $(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_CONFIG_DIR ?= $(INSTALL_DIR)/boot
LINUX_SRC_PATH ?= .:..
-LINUX_SRC_X ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),$(wildcard $(dir)/linux-$(LINUX_VER).tar.gz)))
+LINUX_SRC_X ?= $(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:
@@ -34,49 +38,54 @@ LINUX_SRC_X = $(LINUX_SRC)
else
ifeq ($(LINUX_SRC_X),)
@echo "Can not 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.gz -O./linux-$(LINUX_VER).tar.gz
-LINUX_SRC_X = ./linux-$(LINUX_VER).tar.gz
+ @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
endif
-patch-xen0-bridge-nf:
- (cd linux-$(LINUX_VER)-xen && patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff)
+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 > $@
+
+LINUX_TREES = linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
# make a linux-xen build tree from a pristine kernel plus sparse tree
-linux-$(LINUX_VER)-xen: pristine-linux-src
- $(RM) -rf linux-$(LINUX_VER)-xen
- tar -x -z -f $(LINUX_SRC_X)
- mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen
- ( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../linux-$(LINUX_VER)-xen )
-
-# config linux-xen from a specified defaults file
-linux_%_config:
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen mrproper
- cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst _config,,$(subst linux_,,$(@))) linux-$(LINUX_VER)-xen/.config || $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen $(subst linux_,,$(@))
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen oldconfig
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen dep
-
-# build and install to a specified install name
-linux_%:
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen modules
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_PATH=$(INSTALL_DIR) install
-
-# shorthand with no siffix
-linux:
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen modules
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
- $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
+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
+ mv linux-$(LINUX_VER) 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)
+
+# configure the specified linux tree
+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
+
+# build the specified linux tree
+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
# build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
# and place them in the install directory. 'make install' should then
# copy them to the normal system directories
-world: dist
- $(MAKE) linux-$(LINUX_VER)-xen
- $(MAKE) linux_xenU_config
- $(MAKE) linux_xenU
- $(MAKE) linux_xen0_config
- $(MAKE) linux_xen0
+world:
+ $(MAKE) clean
+ $(MAKE) all
+ $(MAKE) mk-linux-trees
+ $(MAKE) config-xenU
+ $(MAKE) linux-xenU
+ $(MAKE) config-xen0
+ $(MAKE) linux-xen0
clean: delete-symlinks
@@ -85,7 +94,7 @@ clean: delete-symlinks
# clean, but blow away linux build tree plus src tar ball
mrproper: clean
- rm -rf install linux-$(LINUX_VER)-xen linux-$(LINUX_VER).tar.gz
+ rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
make-symlinks: delete-symlinks
@@ -94,4 +103,16 @@ make-symlinks: delete-symlinks
delete-symlinks:
$(RM) linux-xen-sparse
+# handy target to install twisted (use rpm or apt-get in preference)
+install-twisted:
+ wget http://www.twistedmatrix.com/products/get-current.epy
+ tar -zxf Twisted-*.tar.gz
+ (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)
+