ia64/xen-unstable

view Makefile @ 2697:a9128b3b9f45

bitkeeper revision 1.1159.126.1 (4177dbc0a3cRDV2S_YVRjp33pMQxuw)

Change licensing terms of certain files in the Linux source tree, and
clarify licensing terms with a new COPYING file at the root of the
repository.
author kaf24@freefall.cl.cam.ac.uk
date Thu Oct 21 15:54:40 2004 +0000 (2004-10-21)
parents 924a0fb0c200
children 2c4a115fcca1
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.6
31 LINUX_VER ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
32 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
33 LINUX26_VER ?= $(shell ( /bin/ls -ld linux-2.6.*-xen-sparse ) 2>/dev/null | \
34 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
35 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
36 LINUX_SRC_PATH ?= .:..
37 LINUX_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
38 $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
40 # search for a pristine kernel tar ball, or try downloading one
41 pristine-linux-src:
42 ifeq ($(LINUX_SRC),)
43 @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
44 @wget http://www.kernel.org/pub/linux/kernel/v$(LINUX_RELEASE)/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
45 LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2
46 endif
48 patches/ebtables.diff:
49 mkdir -p patches
50 #wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
51 -O- | gunzip -c > $@
52 wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@
54 LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
56 # make a linux-xen build tree from a pristine kernel plus sparse tree
57 ifeq ($(LINUX_RELEASE),2.4)
58 mk-linux-trees: patches/ebtables.diff pristine-linux-src
59 $(RM) -rf $(LINUX_TREES)
60 echo $(LINUX_SRC) | grep -q bz2 && \
61 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
62 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
63 ( cd linux-$(LINUX_VER)-xen-sparse ; \
64 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
65 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
66 ( cd linux-$(LINUX_VER)-xen0 ; \
67 patch -p1 -F3 < ../patches/ebtables.diff )
68 else
69 mk-linux-trees: pristine-linux-src
70 $(RM) -rf $(LINUX_TREES)
71 echo $(LINUX_SRC) | grep -q bz2 && \
72 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
73 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
74 ( cd linux-$(LINUX_VER)-xen-sparse ; \
75 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
76 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
77 endif
79 # configure the specified linux tree
80 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
81 ifeq ($(LINUX_RELEASE),2.4)
82 config-xen%:
83 $(MAKE) -C $(CDIR) ARCH=xen mrproper
84 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
85 $(CDIR)/.config || \
86 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
87 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
88 $(MAKE) -C $(CDIR) ARCH=xen dep
89 else
90 config-xen%:
91 $(MAKE) -C $(CDIR) ARCH=xen mrproper
92 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
93 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
94 $(CDIR)/.config || \
95 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
96 endif
98 # build the specified linux tree
99 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
100 linux-xen%:
101 $(MAKE) -C $(BDIR) ARCH=xen modules
102 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
103 modules_install
104 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
107 NETBSD_RELEASE ?= 2.0
108 NETBSD_VER ?= $(shell ( /bin/ls -ld netbsd-$(NETBSD_RELEASE)*-xen-sparse ) 2>/dev/null | \
109 sed -e 's!^.*netbsd-\(.\+\)-xen-sparse!\1!' )
110 NETBSD_CVSSNAP ?= 20040906
111 NETBSD_SRC_PATH ?= .:..
112 NETBSD_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
113 $(wildcard $(dir)/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.*z*)))
114 NETBSD_TOOLS_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
115 $(wildcard $(dir)/netbsd-$(NETBSD_VER)-tools.tar.*z*)))
117 NETBSD_TREES := netbsd-$(NETBSD_VER)-xenU
119 pristine-netbsd-src:
120 ifeq ($(NETBSD_SRC),)
121 @echo "Cannot find netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.gz in path $(NETBSD_SRC_PATH)"
122 @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
123 NETBSD_SRC := ./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
124 endif
126 pristine-netbsd-tools-src:
127 ifeq ($(NETBSD_TOOLS_SRC),)
128 @echo "Cannot find netbsd-$(NETBSD_VER)-tools.tar.gz in path $(NETBSD_SRC_PATH)"
129 @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
130 NETBSD_TOOLS_SRC := ./netbsd-$(NETBSD_VER)-tools.tar.bz2
131 endif
133 netbsd-tools: pristine-netbsd-tools-src
134 @[ -d netbsd-$(NETBSD_RELEASE)-tools ] || { \
135 echo extract $(NETBSD_TOOLS_SRC); \
136 tar -jxf $(NETBSD_TOOLS_SRC); }
138 mk-netbsd-trees: netbsd-tools pristine-netbsd-src
139 $(RM) -rf $(NETBSD_TREES)
140 echo $(NETBSD_SRC) | grep -q bz2 && \
141 tar -jxf $(NETBSD_SRC) || tar -zxf $(NETBSD_SRC)
142 mv netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP) \
143 netbsd-$(NETBSD_VER)-xenU
144 ( cd netbsd-$(NETBSD_VER)-xen-sparse ; \
145 ./mkbuildtree ../netbsd-$(NETBSD_VER)-xenU )
147 # build the specified netbsd tree
148 NBDIR = $(subst netbsd-,netbsd-$(NETBSD_VER)-,$@)
149 netbsd-xen%:
150 $(MAKE) -C $(NBDIR) config
151 $(MAKE) -C $(NBDIR) netbsd
152 $(MAKE) -C $(NBDIR) INSTALL_PATH=$(INSTALL_DIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-$(subst netbsd-,,$@) install
154 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
155 # and place them in the install directory. 'make install' should then
156 # copy them to the normal system directories
157 world:
158 $(MAKE) clean
159 $(MAKE) all
160 $(MAKE) mk-linux-trees
161 $(MAKE) config-xenU
162 $(MAKE) linux-xenU
163 $(MAKE) config-xen0
164 $(MAKE) linux-xen0
165 $(MAKE) docs
167 linux26:
168 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
169 $(MAKE) LINUX_RELEASE=2.6 config-xenU
170 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
171 $(MAKE) LINUX_RELEASE=2.6 config-xen0
172 $(MAKE) LINUX_RELEASE=2.6 linux-xen0
174 linux24:
175 $(MAKE) LINUX_RELEASE=2.4 mk-linux-trees
176 $(MAKE) LINUX_RELEASE=2.4 config-xenU
177 $(MAKE) LINUX_RELEASE=2.4 linux-xenU
178 $(MAKE) LINUX_RELEASE=2.4 config-xen0
179 $(MAKE) LINUX_RELEASE=2.4 linux-xen0
181 netbsd:
182 $(MAKE) mk-netbsd-trees
183 $(MAKE) netbsd-xenU
185 clean: delete-symlinks
186 $(MAKE) -C xen clean
187 $(MAKE) -C tools clean
188 $(MAKE) -C docs clean
190 # clean, but blow away linux build tree plus src tar ball
191 mrproper: clean
192 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
194 make-symlinks: delete-symlinks
195 ln -sf linux-$(LINUX26_VER)-xen-sparse linux-xen-sparse
197 delete-symlinks:
198 $(RM) linux-xen-sparse
200 # handy target to install twisted (use rpm or apt-get in preference)
201 install-twisted:
202 wget http://www.twistedmatrix.com/products/get-current.epy
203 tar -zxf Twisted-*.tar.gz
204 ( cd Twisted-* ; python setup.py install )
206 install-logging: LOGGING=logging-0.4.9.2
207 install-logging:
208 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
209 tar -zxf $(LOGGING).tar.gz
210 ( cd $(LOGGING) && python setup.py install )
212 # handy target to upgrade iptables (use rpm or apt-get in preference)
213 install-iptables:
214 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
215 tar -jxf iptables-*.tar.bz2
216 ( cd iptables-* ; \
217 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
219 uninstall:
220 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
221 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
223 docs:
224 $(MAKE) -C docs all || true