ia64/xen-unstable

view Makefile @ 18836:ab0c1bdede53

Merge with ia64 tree.
author Keir Fraser <keir.fraser@citrix.com>
date Wed Nov 26 11:14:26 2008 +0000 (2008-11-26)
parents b53b02976633
children d6889b3b6423
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 # Default target must appear before any include lines
6 .PHONY: all
7 all: dist
9 export XEN_ROOT=$(CURDIR)
10 include Config.mk
12 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
13 export XEN_TARGET_ARCH SUBARCH XEN_SYSTYPE
14 include buildconfigs/Rules.mk
16 # build and install everything into the standard system directories
17 .PHONY: install
18 install: install-xen install-kernels install-tools install-stubdom install-docs
20 .PHONY: build
21 build: kernels
22 $(MAKE) -C xen build
23 $(MAKE) -C tools build
24 $(MAKE) -C stubdom build
25 ifeq (x86_64,$(XEN_TARGET_ARCH))
26 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub
27 endif
28 $(MAKE) -C docs build
30 # The test target is for unit tests that can run without an installation. Of
31 # course, many tests require a machine running Xen itself, and these are
32 # handled elsewhere.
33 .PHONY: test
34 test:
35 $(MAKE) -C tools/python test
37 # build and install everything into local dist directory
38 .PHONY: dist
39 dist: DESTDIR=$(DISTDIR)/install
40 dist: dist-xen dist-kernels dist-tools dist-stubdom dist-docs
41 $(INSTALL_DIR) $(DISTDIR)/check
42 $(INSTALL_DATA) ./COPYING $(DISTDIR)
43 $(INSTALL_DATA) ./README $(DISTDIR)
44 $(INSTALL_PROG) ./install.sh $(DISTDIR)
45 $(INSTALL_PROG) tools/check/chk tools/check/check_* tools/check/funcs.sh $(DISTDIR)/check
46 dist-%: DESTDIR=$(DISTDIR)/install
47 dist-%: install-%
48 @: # do nothing
50 # Legacy dist targets
51 .PHONY: xen tools stubdom kernels docs
52 xen: dist-xen
53 tools: dist-tools
54 kernels: dist-kernels
55 stubdom: dist-stubdom
56 docs: dist-docs
58 .PHONY: prep-kernels
59 prep-kernels:
60 for i in $(XKERNELS) ; do $(MAKE) $$i-prep || exit 1; done
62 .PHONY: install-xen
63 install-xen:
64 $(MAKE) -C xen install
66 .PHONY: install-tools
67 install-tools: tools/ioemu-dir
68 $(MAKE) -C tools install
70 .PHONY: install-kernels
71 install-kernels:
72 for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
74 .PHONY: install-stubdom
75 install-stubdom: tools/ioemu-dir
76 $(MAKE) -C stubdom install
77 ifeq (x86_64,$(XEN_TARGET_ARCH))
78 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
79 endif
81 tools/ioemu-dir:
82 $(MAKE) -C tools ioemu-dir-find
84 .PHONY: install-docs
85 install-docs:
86 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
88 .PHONY: dev-docs
89 dev-docs:
90 $(MAKE) -C docs dev-docs
92 # Build all the various kernels and modules
93 .PHONY: kbuild
94 kbuild: kernels
96 # Delete the kernel build trees entirely
97 .PHONY: kdelete
98 kdelete:
99 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
101 # Clean the kernel build trees
102 .PHONY: kclean
103 kclean:
104 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
106 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
107 # and place them in the install directory. 'make install' should then
108 # copy them to the normal system directories
109 .PHONY: world
110 world:
111 $(MAKE) clean
112 $(MAKE) kdelete
113 $(MAKE) dist
115 # clean doesn't do a kclean
116 .PHONY: clean
117 clean::
118 $(MAKE) -C xen clean
119 $(MAKE) -C tools clean
120 $(MAKE) -C stubdom crossclean
121 ifeq (x86_64,$(XEN_TARGET_ARCH))
122 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom crossclean
123 endif
124 $(MAKE) -C docs clean
126 # clean, but blow away kernel build tree plus tarballs
127 .PHONY: distclean
128 distclean:
129 $(MAKE) -C xen distclean
130 $(MAKE) -C tools distclean
131 $(MAKE) -C stubdom distclean
132 ifeq (x86_64,$(XEN_TARGET_ARCH))
133 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
134 endif
135 $(MAKE) -C docs distclean
136 rm -rf dist patches/tmp
137 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
138 rm -rf patches/*/.makedep
140 # Linux name for GNU distclean
141 .PHONY: mrproper
142 mrproper: distclean
144 # Prepare for source tarball
145 .PHONY: src-tarball
146 src-tarball: distclean
147 $(MAKE) -C xen .banner
148 rm -rf xen/tools/figlet .[a-z]*
149 $(MAKE) -C xen distclean
151 .PHONY: help
152 help:
153 @echo 'Installation targets:'
154 @echo ' install - build and install everything'
155 @echo ' install-xen - build and install the Xen hypervisor'
156 @echo ' install-tools - build and install the control tools'
157 @echo ' install-kernels - build and install guest kernels'
158 @echo ' install-stubdom - build and install the stubdomain images'
159 @echo ' install-docs - build and install user documentation'
160 @echo ''
161 @echo 'Building targets:'
162 @echo ' dist - build and install everything into local dist directory'
163 @echo ' world - clean everything, delete guest kernel build'
164 @echo ' trees then make dist'
165 @echo ' xen - build and install Xen hypervisor'
166 @echo ' tools - build and install tools'
167 @echo ' stubdom - build and install the stubdomain images'
168 @echo ' kernels - build and install guest kernels'
169 @echo ' kbuild - synonym for make kernels'
170 @echo ' docs - build and install user documentation'
171 @echo ' dev-docs - build developer-only documentation'
172 @echo ''
173 @echo 'Cleaning targets:'
174 @echo ' clean - clean the Xen, tools and docs (but not guest kernel trees)'
175 @echo ' distclean - clean plus delete kernel build trees and'
176 @echo ' local downloaded files'
177 @echo ' kdelete - delete guest kernel build trees'
178 @echo ' kclean - clean guest kernel build trees'
179 @echo ''
180 @echo 'Miscellaneous targets:'
181 @echo ' prep-kernels - prepares kernel directories, does not build'
182 @echo ' uninstall - attempt to remove installed Xen tools'
183 @echo ' (use with extreme care!)'
184 @echo
185 @echo 'Trusted Boot (tboot) targets:'
186 @echo ' build-tboot - download and build the tboot module'
187 @echo ' install-tboot - download, build, and install the tboot module'
188 @echo ' clean-tboot - clean the tboot module if it exists'
189 @echo
190 @echo 'Environment:'
191 @echo ' XEN_PYTHON_NATIVE_INSTALL=y'
192 @echo ' - native python install or dist'
193 @echo ' install into prefix/lib/python<VERSION>'
194 @echo ' instead of <PREFIX>/lib/python'
195 @echo ' true if set to non-empty value, false otherwise'
197 # Use this target with extreme care!
198 .PHONY: uninstall
199 uninstall: D=$(DESTDIR)
200 uninstall:
201 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date +%s` || true
202 rm -rf $(D)/etc/init.d/xend*
203 rm -rf $(D)/etc/hotplug/xen-backend.agent
204 rm -f $(D)/etc/udev/rules.d/xen-backend.rules
205 rm -f $(D)/etc/udev/xen-backend.rules
206 rm -f $(D)/etc/sysconfig/xendomains
207 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
208 rm -rf $(D)/boot/*xen*
209 rm -rf $(D)/lib/modules/*xen*
210 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/lomount
211 rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
212 rm -rf $(D)/usr/bin/xc_shadow
213 rm -rf $(D)/usr/bin/pygrub
214 rm -rf $(D)/usr/bin/setsize $(D)/usr/bin/tbctl
215 rm -rf $(D)/usr/bin/xsls
216 rm -rf $(D)/usr/include/xenctrl.h $(D)/usr/include/xenguest.h
217 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
218 rm -rf $(D)/usr/include/xen
219 rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
220 rm -rf $(D)$(LIBDIR)/libxenstore*
221 rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
222 rm -rf $(D)$(LIBDIR)/xen/
223 rm -rf $(D)/usr/lib/xen/
224 rm -rf $(D)/usr/local/sbin/setmask $(D)/usr/local/sbin/xen*
225 rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
226 rm -rf $(D)/usr/share/doc/xen
227 rm -rf $(D)/usr/share/xen
228 rm -rf $(D)/usr/share/man/man1/xen*
229 rm -rf $(D)/usr/share/man/man8/xen*
230 rm -rf $(D)/boot/tboot*
232 # Legacy targets for compatibility
233 .PHONY: linux26
234 linux26:
235 $(MAKE) 'KERNELS=linux-2.6*' kernels
238 #
239 # tboot targets
240 #
242 TBOOT_TARFILE = tboot-20080613.tar.gz
243 TBOOT_BASE_URL = http://downloads.sourceforge.net/tboot
245 .PHONY: build-tboot
246 build-tboot: download_tboot
247 $(MAKE) -C tboot build
249 .PHONY: install-tboot
250 install-tboot: download_tboot
251 $(MAKE) -C tboot install
253 .PHONY: dist-tboot
254 dist-tboot: download_tboot
255 $(MAKE) DESTDIR=$(DISTDIR)/install -C tboot dist
257 .PHONY: clean-tboot
258 clean-tboot:
259 [ ! -d tboot ] || $(MAKE) -C tboot clean
261 .PHONY: distclean-tboot
262 distclean-tboot:
263 [ ! -d tboot ] || $(MAKE) -C tboot distclean
265 .PHONY: download_tboot
266 download_tboot: tboot/Makefile
268 tboot/Makefile: tboot/$(TBOOT_TARFILE)
269 [ -e tboot/Makefile ] || tar -xzf tboot/$(TBOOT_TARFILE) -C tboot/ --strip-components 1
271 tboot/$(TBOOT_TARFILE):
272 mkdir -p tboot
273 wget -O tboot/$(TBOOT_TARFILE) $(TBOOT_BASE_URL)/$(TBOOT_TARFILE)