ia64/xen-unstable

view Makefile @ 1968:718664f12c65

bitkeeper revision 1.1108.1.40 (4107e8efoXyUiieXlb75MGiyF2XkXg)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/ach61/xeno-clone/xeno.bk
author ach61@labyrinth.cl.cam.ac.uk
date Wed Jul 28 17:57:03 2004 +0000 (2004-07-28)
parents be1be474b56f
children bd0ea1284933 2afb533685cb
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)-xen0
71 ( cd linux-$(LINUX_VER)-xen-sparse ; \
72 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
73 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
74 endif
76 # configure the specified linux tree
77 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
78 ifeq ($(LINUX_RELEASE),2.4)
79 config-xen%:
80 $(MAKE) -C $(CDIR) ARCH=xen mrproper
81 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
82 $(CDIR)/.config || \
83 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
84 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
85 $(MAKE) -C $(CDIR) ARCH=xen dep
86 else
87 config-xen%:
88 $(MAKE) -C $(CDIR) ARCH=xen mrproper
89 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
90 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
91 $(CDIR)/.config || \
92 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
93 endif
95 # build the specified linux tree
96 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
97 linux-xen%:
98 $(MAKE) -C $(BDIR) ARCH=xen modules
99 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
100 modules_install
101 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
103 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
104 # and place them in the install directory. 'make install' should then
105 # copy them to the normal system directories
106 world:
107 $(MAKE) clean
108 $(MAKE) all
109 $(MAKE) mk-linux-trees
110 $(MAKE) config-xenU
111 $(MAKE) linux-xenU
112 $(MAKE) config-xen0
113 $(MAKE) linux-xen0
114 $(MAKE) docs
116 linux26:
117 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
118 $(MAKE) LINUX_RELEASE=2.6 config-xenU
119 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
122 clean: delete-symlinks
123 $(MAKE) -C xen clean
124 $(MAKE) -C tools clean
125 $(MAKE) -C docs clean
127 # clean, but blow away linux build tree plus src tar ball
128 mrproper: clean
129 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
131 make-symlinks: delete-symlinks
132 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
134 delete-symlinks:
135 $(RM) linux-xen-sparse
137 # handy target to install twisted (use rpm or apt-get in preference)
138 install-twisted:
139 wget http://www.twistedmatrix.com/products/get-current.epy
140 tar -zxf Twisted-*.tar.gz
141 ( cd Twisted-* ; python setup.py install )
143 install-logging: LOGGING=logging-0.4.9.2
144 install-logging:
145 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
146 tar -xfz $(LOGGING).tar.gz
147 ( cd $(LOGGING) && python setup.py install )
149 # handy target to upgrade iptables (use rpm or apt-get in preference)
150 install-iptables:
151 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
152 tar -jxf iptables-*.tar.bz2
153 ( cd iptables-* ; \
154 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
156 uninstall:
157 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
158 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
160 docs:
161 $(MAKE) -C docs all || true