ia64/xen-unstable

view Makefile @ 3528:5580df9a800b

bitkeeper revision 1.1159.223.36 (41f644c9famqz8rwdr0g7NzC9KVv3g)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno/users/iap10/xeno-clone/xen-2.0-testing.bk
author iap10@freefall.cl.cam.ac.uk
date Tue Jan 25 13:08:25 2005 +0000 (2005-01-25)
parents 288b96264654 df9a2053655e
children 51052c8b6456 ae14fa1d3691
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 DIST_DIR := $(CURDIR)/dist
6 DESTDIR := $(DIST_DIR)/install
8 INSTALL := install
9 INSTALL_DIR := $(INSTALL) -d -m0755
10 INSTALL_DATA := $(INSTALL) -m0644
11 INSTALL_PROG := $(INSTALL) -m0755
13 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
14 # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
15 # You may use wildcards in the above e.g. KERNELS=*2.4*
17 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
18 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
19 XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
22 export DESTDIR
24 include buildconfigs/Rules.mk
26 .PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper
27 .PHONY: kbuild kdelete kclean install-tools install-xen install-docs
28 .PHONY: install-kernels
30 all: dist
32 # install everything into the standard system directories
33 # NB: install explicitly does not check that everything is up to date!
34 install: install-tools install-xen install-kernels install-docs
36 install-xen:
37 $(MAKE) -C xen install
39 install-tools:
40 $(MAKE) -C tools install
42 install-kernels:
43 cp -a $(INSTALL_DIR)/boot/* /boot/
44 cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/
45 cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/
46 cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/
48 install-docs:
49 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
50 sh ./docs/check_pkgs
51 -$(MAKE) -C docs install
53 # build and install everything into local dist directory
54 dist: xen tools kernels docs
55 $(INSTALL_DIR) $(DIST_DIR)/check
56 $(INSTALL_DATA) ./COPYING $(DIST_DIR)
57 $(INSTALL_DATA) ./README $(DIST_DIR)
58 $(INSTALL_PROG) ./install.sh $(DIST_DIR)
59 $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DIST_DIR)/check
61 xen:
62 $(MAKE) dist=yes -C xen install
64 tools:
65 $(MAKE) dist=yes -C tools install
67 kernels:
68 for i in $(XKERNELS) ; do $(MAKE) $$i-build || exit 1; done
70 docs:
71 sh ./docs/check_pkgs
72 -$(MAKE) dist=yes -C docs install
74 # Build all the various kernels and modules
75 kbuild: kernels
77 # Delete the kernel build trees entirely
78 kdelete:
79 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
81 # Clean the kernel build trees
82 kclean:
83 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
85 # Make patches from kernel sparse trees
86 mkpatches:
87 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch || exit 1; done
90 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
91 # and place them in the install directory. 'make install' should then
92 # copy them to the normal system directories
93 world:
94 $(MAKE) clean
95 $(MAKE) kdelete
96 $(MAKE) dist
98 # clean doesn't do a kclean
99 clean:
100 $(MAKE) -C xen clean
101 $(MAKE) -C tools clean
102 $(MAKE) -C docs clean
104 # clean, but blow away kernel build tree plus tar balls
105 mrproper: clean
106 rm -rf dist patches/tmp
107 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
108 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
110 install-twisted:
111 wget http://www.twistedmatrix.com/products/get-current.epy
112 tar -zxf Twisted-*.tar.gz
113 cd Twisted-* && python setup.py install
115 install-logging: LOGGING=logging-0.4.9.2
116 install-logging:
117 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
118 tar -zxf $(LOGGING).tar.gz
119 cd $(LOGGING) && python setup.py install
121 # handy target to upgrade iptables (use rpm or apt-get in preference)
122 install-iptables:
123 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
124 tar -jxf iptables-1.2.11.tar.bz2
125 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
127 help:
128 @echo 'Installation targets:'
129 @echo ' install - install everything'
130 @echo ' install-xen - install the Xen hypervisor'
131 @echo ' install-tools - install the control tools'
132 @echo ' install-kernels - install guest kernels'
133 @echo ' install-docs - install documentation'
134 @echo ''
135 @echo 'Building targets:'
136 @echo ' dist - build everything and place in dist/'
137 @echo ' world - clean everything, delete guest kernel build'
138 @echo ' trees then make dist'
139 @echo ' xen - build Xen hypervisor and place in dist/'
140 @echo ' tools - build tools and place in dist/'
141 @echo ' kernels - build guest kernels and place in dist/'
142 @echo ' kbuild - synonym for make kernels'
143 @echo ' docs - build docs and place in dist/'
144 @echo ''
145 @echo 'Cleaning targets:'
146 @echo ' clean - clean the Xen, tools and docs (but not'
147 @echo ' guest kernel) trees'
148 @echo ' mrproper - clean plus delete kernel tarballs and kernel'
149 @echo ' build trees'
150 @echo ' kdelete - delete guest kernel build trees'
151 @echo ' kclean - clean guest kernel build trees'
152 @echo ''
153 @echo 'Dependency installation targets:'
154 @echo ' install-twisted - install the Twisted Matrix Framework'
155 @echo ' install-logging - install the Python Logging package'
156 @echo ' install-iptables - install iptables tools'
157 @echo ''
158 @echo 'Miscellaneous targets:'
159 @echo ' mkpatches - make patches against vanilla kernels from'
160 @echo ' sparse trees'
161 @echo ' uninstall - attempt to remove installed Xen tools (use'
162 @echo ' with extreme care!)'
164 # Use this target with extreme care!
165 uninstall:
166 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
167 rm -rf "/usr/lib/python2.?/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.?/site-packages/Xc*"
169 # Legacy targets for compatibility
170 linux24:
171 $(MAKE) linux-2.4-xen0-build
172 $(MAKE) linux-2.4-xenU-build
174 linux26:
175 $(MAKE) linux-2.6-xen0-build
176 $(MAKE) linux-2.6-xenU-build
178 netbsd20:
179 $(MAKE) netbsd-2.0-xenU-build