ia64/xen-unstable

view Makefile @ 1790:565101380290

bitkeeper revision 1.1086.1.1 (40f56ab7cyHUfU9X0WmyoukR0LaXcQ)

Simple uninstall option to top-level Makefile
author iap10@labyrinth.cl.cam.ac.uk
date Wed Jul 14 17:17:43 2004 +0000 (2004-07-14)
parents cbf1c89cb69b
children b0c6d5d450ad
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_VER ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | \
29 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
30 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
31 LINUX_SRC_PATH ?= .:..
32 LINUX_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
33 $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
35 # search for a pristine kernel tar ball, or try downloading one
36 pristine-linux-src:
37 ifeq ($(LINUX_SRC),)
38 @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
39 @wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
40 LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2
41 endif
43 patches/ebtables-brnf-5_vs_2.4.25.diff:
44 mkdir -p patches
45 wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
46 -O- | gunzip -c > $@
48 LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
50 # make a linux-xen build tree from a pristine kernel plus sparse tree
51 mk-linux-trees: patches/ebtables-brnf-5_vs_2.4.25.diff pristine-linux-src
52 $(RM) -rf $(LINUX_TREES)
53 echo $(LINUX_SRC) | grep -q bz2 && \
54 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
55 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
56 ( cd linux-$(LINUX_VER)-xen-sparse ; \
57 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
58 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
59 ( cd linux-$(LINUX_VER)-xen0 ; \
60 patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff )
62 # configure the specified linux tree
63 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
64 config-xen%:
65 $(MAKE) -C $(CDIR) ARCH=xen mrproper
66 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
67 $(CDIR)/.config || \
68 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
69 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
70 $(MAKE) -C $(CDIR) ARCH=xen dep
72 # build the specified linux tree
73 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
74 linux-xen%:
75 $(MAKE) -C $(BDIR) ARCH=xen modules
76 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
77 modules_install
78 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
80 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
81 # and place them in the install directory. 'make install' should then
82 # copy them to the normal system directories
83 world:
84 $(MAKE) clean
85 $(MAKE) all
86 $(MAKE) mk-linux-trees
87 $(MAKE) config-xenU
88 $(MAKE) linux-xenU
89 $(MAKE) config-xen0
90 $(MAKE) linux-xen0
93 clean: delete-symlinks
94 $(MAKE) -C xen clean
95 $(MAKE) -C tools clean
97 # clean, but blow away linux build tree plus src tar ball
98 mrproper: clean
99 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
101 make-symlinks: delete-symlinks
102 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
104 delete-symlinks:
105 $(RM) linux-xen-sparse
107 # handy target to install twisted (use rpm or apt-get in preference)
108 install-twisted:
109 wget http://www.twistedmatrix.com/products/get-current.epy
110 tar -zxf Twisted-*.tar.gz
111 ( cd Twisted-* ; python setup.py install )
113 # handy target to upgrade iptables (use rpm or apt-get in preference)
114 install-iptables:
115 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
116 tar -jxf iptables-*.tar.bz2
117 ( cd iptables-* ; \
118 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
120 uninstall:
121 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
122 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"