ia64/xen-unstable

view Makefile @ 2236:a628543fb437

bitkeeper revision 1.1159.30.1 (411ddb8cj12XLuMNx_qS9SGeej51OQ)

cpu_weight parameter added to the xm create command. Minor bug fix for BVT.
author gm281@boulderdash.cl.cam.ac.uk
date Sat Aug 14 09:29:48 2004 +0000 (2004-08-14)
parents dae98734f12e
children d5ce93aeedc5 869c20f2977b 0a4b76b6b5a0
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 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-brnf-5_vs_2.4.25.diff:
49 mkdir -p patches
50 wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
51 -O- | gunzip -c > $@
53 LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
55 # make a linux-xen build tree from a pristine kernel plus sparse tree
56 ifeq ($(LINUX_RELEASE),2.4)
57 mk-linux-trees: patches/ebtables-brnf-5_vs_2.4.25.diff pristine-linux-src
58 $(RM) -rf $(LINUX_TREES)
59 echo $(LINUX_SRC) | grep -q bz2 && \
60 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
61 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
62 ( cd linux-$(LINUX_VER)-xen-sparse ; \
63 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
64 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
65 ( cd linux-$(LINUX_VER)-xen0 ; \
66 patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff )
67 else
68 mk-linux-trees: pristine-linux-src
69 $(RM) -rf $(LINUX_TREES)
70 echo $(LINUX_SRC) | grep -q bz2 && \
71 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
72 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
73 ( cd linux-$(LINUX_VER)-xen-sparse ; \
74 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
75 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
76 endif
78 # configure the specified linux tree
79 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
80 ifeq ($(LINUX_RELEASE),2.4)
81 config-xen%:
82 $(MAKE) -C $(CDIR) ARCH=xen mrproper
83 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
84 $(CDIR)/.config || \
85 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
86 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
87 $(MAKE) -C $(CDIR) ARCH=xen dep
88 else
89 config-xen%:
90 $(MAKE) -C $(CDIR) ARCH=xen mrproper
91 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
92 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
93 $(CDIR)/.config || \
94 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
95 endif
97 # build the specified linux tree
98 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
99 linux-xen%:
100 $(MAKE) -C $(BDIR) ARCH=xen modules
101 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
102 modules_install
103 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
105 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
106 # and place them in the install directory. 'make install' should then
107 # copy them to the normal system directories
108 world:
109 $(MAKE) clean
110 $(MAKE) all
111 $(MAKE) mk-linux-trees
112 $(MAKE) config-xenU
113 $(MAKE) linux-xenU
114 $(MAKE) config-xen0
115 $(MAKE) linux-xen0
116 $(MAKE) docs
118 linux26:
119 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
120 $(MAKE) LINUX_RELEASE=2.6 config-xenU
121 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
122 $(MAKE) LINUX_RELEASE=2.6 config-xen0
123 $(MAKE) LINUX_RELEASE=2.6 linux-xen0
126 clean: delete-symlinks
127 $(MAKE) -C xen clean
128 $(MAKE) -C tools clean
129 $(MAKE) -C docs clean
131 # clean, but blow away linux build tree plus src tar ball
132 mrproper: clean
133 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
135 make-symlinks: delete-symlinks
136 ln -sf linux-$(LINUX26_VER)-xen-sparse linux-xen-sparse
138 delete-symlinks:
139 $(RM) linux-xen-sparse
141 # handy target to install twisted (use rpm or apt-get in preference)
142 install-twisted:
143 wget http://www.twistedmatrix.com/products/get-current.epy
144 tar -zxf Twisted-*.tar.gz
145 ( cd Twisted-* ; python setup.py install )
147 install-logging: LOGGING=logging-0.4.9.2
148 install-logging:
149 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
150 tar -zxf $(LOGGING).tar.gz
151 ( cd $(LOGGING) && python setup.py install )
153 # handy target to upgrade iptables (use rpm or apt-get in preference)
154 install-iptables:
155 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
156 tar -jxf iptables-*.tar.bz2
157 ( cd iptables-* ; \
158 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
160 uninstall:
161 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
162 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
164 docs:
165 $(MAKE) -C docs all || true