direct-io.hg

view Makefile @ 2821:724449a888fe

bitkeeper revision 1.1159.1.332 (41874e954CLIDA2J3phVFD2RnzVTpA)

Clean up public XenLinux header files. Now accessible from userspace as
#include <xen/linux...>
Got rid of the linux-xen-sparse symlink as it's no longer needed.
author kaf24@freefall.cl.cam.ac.uk
date Tue Nov 02 09:08:37 2004 +0000 (2004-11-02)
parents 4cec04241b9b
children 4bf285a87365 eb0280fe0abf
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:
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 sed -e 's/^EXTRAVERSION.*/&-xen0/' Makefile >Mk.tmp ; \
69 rm -f Makefile ; mv Mk.tmp Makefile )
70 ( cd linux-$(LINUX_VER)-xenU ; \
71 sed -e 's/^EXTRAVERSION.*/&-xenU/' Makefile >Mk.tmp ; \
72 rm -f Makefile ; mv Mk.tmp Makefile )
73 else
74 mk-linux-trees: pristine-linux-src
75 $(RM) -rf $(LINUX_TREES)
76 echo $(LINUX_SRC) | grep -q bz2 && \
77 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
78 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
79 ( cd linux-$(LINUX_VER)-xen-sparse ; \
80 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
81 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
82 ( cd linux-$(LINUX_VER)-xen0 ; \
83 sed -e 's/^EXTRAVERSION.*/&-xen0/' Makefile >Mk.tmp ; \
84 rm -f Makefile ; mv Mk.tmp Makefile )
85 ( cd linux-$(LINUX_VER)-xenU ; \
86 sed -e 's/^EXTRAVERSION.*/&-xenU/' Makefile >Mk.tmp ; \
87 rm -f Makefile ; mv Mk.tmp Makefile )
88 endif
90 # configure the specified linux tree
91 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
92 ifeq ($(LINUX_RELEASE),2.4)
93 config-xen%:
94 $(MAKE) -C $(CDIR) ARCH=xen mrproper
95 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)$(subst config,,$@) \
96 $(CDIR)/.config || \
97 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
98 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
99 $(MAKE) -C $(CDIR) ARCH=xen dep
100 else
101 config-xen%:
102 $(MAKE) -C $(CDIR) ARCH=xen mrproper
103 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
104 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
105 $(CDIR)/.config || \
106 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
107 endif
109 # build the specified linux tree
110 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
111 linux-xen%:
112 $(MAKE) -C $(BDIR) ARCH=xen modules
113 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
114 modules_install
115 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
117 NETBSD_RELEASE ?= 2.0
118 NETBSD_VER ?= $(shell ( /bin/ls -ld netbsd-$(NETBSD_RELEASE)*-xen-sparse ) 2>/dev/null | \
119 sed -e 's!^.*netbsd-\(.\+\)-xen-sparse!\1!' )
120 NETBSD_CVSSNAP ?= 20040906
121 NETBSD_SRC_PATH ?= .:..
122 NETBSD_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
123 $(wildcard $(dir)/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.*z*)))
124 NETBSD_TOOLS_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
125 $(wildcard $(dir)/netbsd-$(NETBSD_VER)-tools.tar.*z*)))
127 NETBSD_TREES := netbsd-$(NETBSD_VER)-xenU
129 pristine-netbsd-src:
130 ifeq ($(NETBSD_SRC),)
131 @echo "Cannot find netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.gz in path $(NETBSD_SRC_PATH)"
132 @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
133 NETBSD_SRC := ./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
134 endif
136 pristine-netbsd-tools-src:
137 ifeq ($(NETBSD_TOOLS_SRC),)
138 @echo "Cannot find netbsd-$(NETBSD_VER)-tools.tar.gz in path $(NETBSD_SRC_PATH)"
139 @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
140 NETBSD_TOOLS_SRC := ./netbsd-$(NETBSD_VER)-tools.tar.bz2
141 endif
143 netbsd-tools: pristine-netbsd-tools-src
144 @[ -d netbsd-$(NETBSD_RELEASE)-tools ] || { \
145 echo extract $(NETBSD_TOOLS_SRC); \
146 tar -jxf $(NETBSD_TOOLS_SRC); }
148 mk-netbsd-trees: netbsd-tools pristine-netbsd-src
149 $(RM) -rf $(NETBSD_TREES)
150 echo $(NETBSD_SRC) | grep -q bz2 && \
151 tar -jxf $(NETBSD_SRC) || tar -zxf $(NETBSD_SRC)
152 mv netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP) \
153 netbsd-$(NETBSD_VER)-xenU
154 ( cd netbsd-$(NETBSD_VER)-xen-sparse ; \
155 ./mkbuildtree ../netbsd-$(NETBSD_VER)-xenU )
157 # build the specified netbsd tree
158 NBDIR = $(subst netbsd-,netbsd-$(NETBSD_VER)-,$@)
159 netbsd-xen%:
160 $(MAKE) -C $(NBDIR) config
161 $(MAKE) -C $(NBDIR) netbsd
162 $(MAKE) -C $(NBDIR) INSTALL_PATH=$(INSTALL_DIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-$(subst netbsd-,,$@) install
164 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
165 # and place them in the install directory. 'make install' should then
166 # copy them to the normal system directories
167 world:
168 $(MAKE) clean
169 $(MAKE) all
170 $(MAKE) mk-linux-trees
171 $(MAKE) config-xenU
172 $(MAKE) linux-xenU
173 $(MAKE) config-xen0
174 $(MAKE) linux-xen0
175 $(MAKE) docs
177 linux26:
178 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
179 $(MAKE) LINUX_RELEASE=2.6 config-xenU
180 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
181 $(MAKE) LINUX_RELEASE=2.6 config-xen0
182 $(MAKE) LINUX_RELEASE=2.6 linux-xen0
184 linux24:
185 $(MAKE) LINUX_RELEASE=2.4 mk-linux-trees
186 $(MAKE) LINUX_RELEASE=2.4 config-xenU
187 $(MAKE) LINUX_RELEASE=2.4 linux-xenU
188 $(MAKE) LINUX_RELEASE=2.4 config-xen0
189 $(MAKE) LINUX_RELEASE=2.4 linux-xen0
191 netbsd:
192 $(MAKE) mk-netbsd-trees
193 $(MAKE) netbsd-xenU
195 clean:
196 $(MAKE) -C xen clean
197 $(MAKE) -C tools clean
198 $(MAKE) -C docs clean
200 # clean, but blow away linux build tree plus src tar ball
201 mrproper: clean
202 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
204 install-twisted:
205 wget http://www.twistedmatrix.com/products/get-current.epy
206 tar -zxf Twisted-*.tar.gz
207 ( cd Twisted-* ; python setup.py install )
209 install-logging: LOGGING=logging-0.4.9.2
210 install-logging:
211 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
212 tar -zxf $(LOGGING).tar.gz
213 ( cd $(LOGGING) && python setup.py install )
215 # handy target to upgrade iptables (use rpm or apt-get in preference)
216 install-iptables:
217 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
218 tar -jxf iptables-*.tar.bz2
219 ( cd iptables-* ; \
220 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
222 uninstall:
223 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
224 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
226 docs:
227 $(MAKE) -C docs all || true