ia64/xen-unstable

view Makefile @ 4958:cc1c80ec8139

bitkeeper revision 1.1432 (428a0372Dg_Q9mIOPOkDIc7D3T4aww)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
author cl349@firebug.cl.cam.ac.uk
date Tue May 17 14:45:06 2005 +0000 (2005-05-17)
parents 22a2623febff
children 4db1d602c934
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 # Default is to install to local 'dist' directory.
6 DISTDIR ?= $(CURDIR)/dist
7 DESTDIR ?= $(DISTDIR)/install
9 INSTALL := install
10 INSTALL_DIR := $(INSTALL) -d -m0755
11 INSTALL_DATA := $(INSTALL) -m0644
12 INSTALL_PROG := $(INSTALL) -m0755
14 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
15 # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
16 # You may use wildcards in the above e.g. KERNELS=*2.4*
18 XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
20 export DESTDIR
22 # Export target architecture overrides to Xen and Linux sub-trees.
23 ifneq ($(XEN_TARGET_ARCH),)
24 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
25 export XEN_TARGET_ARCH SUBARCH
26 endif
28 include Config.mk
29 include buildconfigs/Rules.mk
31 .PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper
32 .PHONY: kbuild kdelete kclean
34 all: dist
36 # build and install everything into the standard system directories
37 install: install-xen install-tools install-kernels install-docs
39 build: kernels
40 $(MAKE) -C xen build
41 $(MAKE) -C tools build
42 $(MAKE) -C docs build
44 # build and install everything into local dist directory
45 dist: xen tools kernels docs
46 $(INSTALL_DIR) $(DISTDIR)/check
47 $(INSTALL_DATA) ./COPYING $(DISTDIR)
48 $(INSTALL_DATA) ./README $(DISTDIR)
49 $(INSTALL_PROG) ./install.sh $(DISTDIR)
50 $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DISTDIR)/check
52 xen:
53 $(MAKE) -C xen install
55 tools:
56 $(MAKE) -C tools install
58 kernels:
59 for i in $(XKERNELS) ; do $(MAKE) $$i-build || exit 1; done
61 docs:
62 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
64 # Build all the various kernels and modules
65 kbuild: kernels
67 # Delete the kernel build trees entirely
68 kdelete:
69 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
71 # Clean the kernel build trees
72 kclean:
73 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
75 # Make patches from kernel sparse trees
76 mkpatches:
77 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch; done
79 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
80 # and place them in the install directory. 'make install' should then
81 # copy them to the normal system directories
82 world:
83 $(MAKE) clean
84 $(MAKE) kdelete
85 $(MAKE) dist
87 # clean doesn't do a kclean
88 clean::
89 $(MAKE) -C xen clean
90 $(MAKE) -C tools clean
91 $(MAKE) -C docs clean
93 # clean, but blow away kernel build tree plus tar balls
94 mrproper: clean
95 rm -rf dist patches/tmp
96 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
97 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
99 install-twisted:
100 wget http://www.twistedmatrix.com/products/get-current.epy
101 tar -zxf Twisted-*.tar.gz
102 cd Twisted-* && python setup.py install
104 install-logging: LOGGING=logging-0.4.9.2
105 install-logging:
106 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
107 tar -zxf $(LOGGING).tar.gz
108 cd $(LOGGING) && python setup.py install
110 # handy target to upgrade iptables (use rpm or apt-get in preference)
111 install-iptables:
112 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
113 tar -jxf iptables-1.2.11.tar.bz2
114 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
116 install-%: DESTDIR=
117 install-%: %
118 @: # do nothing
120 help:
121 @echo 'Installation targets:'
122 @echo ' install - build and install everything'
123 @echo ' install-xen - build and install the Xen hypervisor'
124 @echo ' install-tools - build and install the control tools'
125 @echo ' install-kernels - build and install guest kernels'
126 @echo ' install-docs - build and install documentation'
127 @echo ''
128 @echo 'Building targets:'
129 @echo ' dist - build and install everything into local dist directory'
130 @echo ' world - clean everything, delete guest kernel build'
131 @echo ' trees then make dist'
132 @echo ' xen - build and install Xen hypervisor'
133 @echo ' tools - build and install tools'
134 @echo ' kernels - build and install guest kernels'
135 @echo ' kbuild - synonym for make kernels'
136 @echo ' docs - build and install docs'
137 @echo ''
138 @echo 'Cleaning targets:'
139 @echo ' clean - clean the Xen, tools and docs (but not'
140 @echo ' guest kernel) trees'
141 @echo ' mrproper - clean plus delete kernel tarballs and kernel'
142 @echo ' build trees'
143 @echo ' kdelete - delete guest kernel build trees'
144 @echo ' kclean - clean guest kernel build trees'
145 @echo ''
146 @echo 'Dependency installation targets:'
147 @echo ' install-twisted - install the Twisted Matrix Framework'
148 @echo ' install-logging - install the Python Logging package'
149 @echo ' install-iptables - install iptables tools'
150 @echo ''
151 @echo 'Miscellaneous targets:'
152 @echo ' mkpatches - make patches against vanilla kernels from'
153 @echo ' sparse trees'
154 @echo ' uninstall - attempt to remove installed Xen tools (use'
155 @echo ' with extreme care!)'
157 # Use this target with extreme care!
158 uninstall: DESTDIR=
159 uninstall: D=$(DESTDIR)
160 uninstall:
161 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-$(date +%s)
162 rm -rf $(D)/etc/init.d/xend*
163 rm -rf $(D)/usr/$(LIBDIR)/libxc* $(D)/usr/$(LIBDIR)/libxutil*
164 rm -rf $(D)/usr/lib/python/xen $(D)/usr/include/xen
165 rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
166 rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
167 rm -rf $(D)/usr/sbin/netfix
168 rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm $(D)/var/lib/xen
169 rm -rf $(D)/usr/share/doc/xen $(D)/usr/man/man*/xentrace*
170 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/miniterm
171 rm -rf $(D)/boot/*xen*
172 rm -rf $(D)/lib/modules/*xen*
174 # Legacy targets for compatibility
175 linux24:
176 $(MAKE) linux-2.4-xen0-build
177 $(MAKE) linux-2.4-xenU-build
179 linux26:
180 $(MAKE) linux-2.6-xen0-build
181 $(MAKE) linux-2.6-xenU-build
183 netbsd20:
184 $(MAKE) netbsd-2.0-xenU-build