ia64/xen-unstable

view Makefile @ 1820:3d4f8eb89670

bitkeeper revision 1.1106.1.2 (40faa780dekT3E5arFwcbQDu1MbX6g)

Cleaned up Xen's instruction emulator.
author kaf24@scramble.cl.cam.ac.uk
date Sun Jul 18 16:38:24 2004 +0000 (2004-07-18)
parents 20b04731d29f
children 1908bce36fa8 dae98734f12e
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 # a not partcularly useful but safe default target
12 all: make-symlinks
13 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
14 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
16 # install everything into the standard system directories
17 install: dist
18 $(MAKE) -C xen install
19 $(MAKE) -C tools install
20 $(shell cp -a install/boot/*$(LINUX_VER)* /boot/)
21 $(shell cp -a install/lib/modules/* /lib/modules/)
23 # install xen and tools into the install directory
24 dist: all
25 $(MAKE) linux-xenU
26 $(MAKE) linux-xen0
28 LINUX_RELEASE ?= 2.4
29 LINUX_VER ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
30 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
31 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
32 LINUX_SRC_PATH ?= .:..
33 LINUX_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
34 $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
36 # search for a pristine kernel tar ball, or try downloading one
37 pristine-linux-src:
38 ifeq ($(LINUX_SRC),)
39 @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
40 @wget http://www.kernel.org/pub/linux/kernel/v$(LINUX_RELEASE)/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
41 LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2
42 endif
44 patches/ebtables-brnf-5_vs_2.4.25.diff:
45 mkdir -p patches
46 wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
47 -O- | gunzip -c > $@
49 LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
51 # make a linux-xen build tree from a pristine kernel plus sparse tree
52 ifeq ($(LINUX_RELEASE),2.4)
53 mk-linux-trees: patches/ebtables-brnf-5_vs_2.4.25.diff pristine-linux-src
54 $(RM) -rf $(LINUX_TREES)
55 echo $(LINUX_SRC) | grep -q bz2 && \
56 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
57 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
58 ( cd linux-$(LINUX_VER)-xen-sparse ; \
59 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
60 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
61 ( cd linux-$(LINUX_VER)-xen0 ; \
62 patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff )
63 else
64 mk-linux-trees: pristine-linux-src
65 $(RM) -rf $(LINUX_TREES)
66 echo $(LINUX_SRC) | grep -q bz2 && \
67 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
68 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xenU
69 ( cd linux-$(LINUX_VER)-xen-sparse ; \
70 ./mkbuildtree ../linux-$(LINUX_VER)-xenU )
71 endif
73 # configure the specified linux tree
74 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
75 ifeq ($(LINUX_RELEASE),2.4)
76 config-xen%:
77 $(MAKE) -C $(CDIR) ARCH=xen mrproper
78 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
79 $(CDIR)/.config || \
80 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
81 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
82 $(MAKE) -C $(CDIR) ARCH=xen dep
83 else
84 config-xen%:
85 $(MAKE) -C $(CDIR) ARCH=xen mrproper
86 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
87 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
88 $(CDIR)/.config || \
89 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
90 endif
92 # build the specified linux tree
93 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
94 linux-xen%:
95 $(MAKE) -C $(BDIR) ARCH=xen modules
96 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
97 modules_install
98 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
100 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
101 # and place them in the install directory. 'make install' should then
102 # copy them to the normal system directories
103 world:
104 $(MAKE) clean
105 $(MAKE) all
106 $(MAKE) mk-linux-trees
107 $(MAKE) config-xenU
108 $(MAKE) linux-xenU
109 $(MAKE) config-xen0
110 $(MAKE) linux-xen0
112 linux26:
113 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
114 $(MAKE) LINUX_RELEASE=2.6 config-xenU
115 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
118 clean: delete-symlinks
119 $(MAKE) -C xen clean
120 $(MAKE) -C tools clean
122 # clean, but blow away linux build tree plus src tar ball
123 mrproper: clean
124 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
126 make-symlinks: delete-symlinks
127 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
129 delete-symlinks:
130 $(RM) linux-xen-sparse
132 # handy target to install twisted (use rpm or apt-get in preference)
133 install-twisted:
134 wget http://www.twistedmatrix.com/products/get-current.epy
135 tar -zxf Twisted-*.tar.gz
136 ( cd Twisted-* ; python setup.py install )
138 # handy target to upgrade iptables (use rpm or apt-get in preference)
139 install-iptables:
140 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
141 tar -jxf iptables-*.tar.bz2
142 ( cd iptables-* ; \
143 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
145 uninstall:
146 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
147 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"