ia64/xen-unstable

view Makefile @ 1927:a83817a4f882

bitkeeper revision 1.1108.23.1 (41063218Lo2jBTfOaHXFy3vKMmTV1Q)

Merge boulderdash.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into boulderdash.cl.cam.ac.uk:/auto/anfs/scratch/boulderdash/gm281/xeno-clone/xeno.bk
author gm281@boulderdash.cl.cam.ac.uk
date Tue Jul 27 10:44:40 2004 +0000 (2004-07-27)
parents ed42e6d6556e
children be1be474b56f
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 INSTALL_DIR ?= $(shell pwd)/install
7 SOURCEFORGE_MIRROR := http://heanet.dl.sourceforge.net/sourceforge
8 #http://voxel.dl.sourceforge.net/sourceforge/
9 #http://easynews.dl.sourceforge.net/sourceforge
11 .PHONY: docs delete-symlinks clean
13 # a not partcularly useful but safe default target
14 all: make-symlinks
15 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
16 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
18 # install everything into the standard system directories
19 install: dist
20 $(MAKE) -C xen install
21 $(MAKE) -C tools install
22 $(shell cp -a install/boot/*$(LINUX_VER)* /boot/)
23 $(shell cp -a install/lib/modules/* /lib/modules/)
25 # install xen and tools into the install directory
26 dist: all
27 $(MAKE) linux-xenU
28 $(MAKE) linux-xen0
30 LINUX_RELEASE ?= 2.4
31 LINUX_VER ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
32 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
33 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
34 LINUX_SRC_PATH ?= .:..
35 LINUX_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
36 $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
38 # search for a pristine kernel tar ball, or try downloading one
39 pristine-linux-src:
40 ifeq ($(LINUX_SRC),)
41 @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
42 @wget http://www.kernel.org/pub/linux/kernel/v$(LINUX_RELEASE)/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
43 LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2
44 endif
46 patches/ebtables-brnf-5_vs_2.4.25.diff:
47 mkdir -p patches
48 wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
49 -O- | gunzip -c > $@
51 LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
53 # make a linux-xen build tree from a pristine kernel plus sparse tree
54 ifeq ($(LINUX_RELEASE),2.4)
55 mk-linux-trees: patches/ebtables-brnf-5_vs_2.4.25.diff pristine-linux-src
56 $(RM) -rf $(LINUX_TREES)
57 echo $(LINUX_SRC) | grep -q bz2 && \
58 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
59 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
60 ( cd linux-$(LINUX_VER)-xen-sparse ; \
61 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
62 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
63 ( cd linux-$(LINUX_VER)-xen0 ; \
64 patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff )
65 else
66 mk-linux-trees: pristine-linux-src
67 $(RM) -rf $(LINUX_TREES)
68 echo $(LINUX_SRC) | grep -q bz2 && \
69 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
70 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xenU
71 ( cd linux-$(LINUX_VER)-xen-sparse ; \
72 ./mkbuildtree ../linux-$(LINUX_VER)-xenU )
73 endif
75 # configure the specified linux tree
76 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
77 ifeq ($(LINUX_RELEASE),2.4)
78 config-xen%:
79 $(MAKE) -C $(CDIR) ARCH=xen mrproper
80 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
81 $(CDIR)/.config || \
82 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
83 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
84 $(MAKE) -C $(CDIR) ARCH=xen dep
85 else
86 config-xen%:
87 $(MAKE) -C $(CDIR) ARCH=xen mrproper
88 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
89 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
90 $(CDIR)/.config || \
91 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
92 endif
94 # build the specified linux tree
95 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
96 linux-xen%:
97 $(MAKE) -C $(BDIR) ARCH=xen modules
98 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
99 modules_install
100 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
102 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
103 # and place them in the install directory. 'make install' should then
104 # copy them to the normal system directories
105 world:
106 $(MAKE) clean
107 $(MAKE) all
108 $(MAKE) mk-linux-trees
109 $(MAKE) config-xenU
110 $(MAKE) linux-xenU
111 $(MAKE) config-xen0
112 $(MAKE) linux-xen0
113 $(MAKE) docs
115 linux26:
116 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
117 $(MAKE) LINUX_RELEASE=2.6 config-xenU
118 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
121 clean: delete-symlinks
122 $(MAKE) -C xen clean
123 $(MAKE) -C tools clean
124 $(MAKE) -C docs clean
126 # clean, but blow away linux build tree plus src tar ball
127 mrproper: clean
128 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
130 make-symlinks: delete-symlinks
131 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
133 delete-symlinks:
134 $(RM) linux-xen-sparse
136 # handy target to install twisted (use rpm or apt-get in preference)
137 install-twisted:
138 wget http://www.twistedmatrix.com/products/get-current.epy
139 tar -zxf Twisted-*.tar.gz
140 ( cd Twisted-* ; python setup.py install )
142 install-logging: LOGGING=logging-0.4.9.2
143 install-logging:
144 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
145 tar -xfz $(LOGGING).tar.gz
146 ( cd $(LOGGING) && python setup.py install )
148 # handy target to upgrade iptables (use rpm or apt-get in preference)
149 install-iptables:
150 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
151 tar -jxf iptables-*.tar.bz2
152 ( cd iptables-* ; \
153 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
155 uninstall:
156 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
157 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
159 docs:
160 $(MAKE) -C docs all || true