ia64/xen-unstable

view Makefile @ 18178:7a35ab9dba8a

fs-back: build fixes for BSD and cleanups.

Signed-of-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jul 28 11:39:32 2008 +0100 (2008-07-28)
parents 63317b6c3eab
children 82edd418d898
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 $(MAKE) -C docs build
27 # The test target is for unit tests that can run without an installation. Of
28 # course, many tests require a machine running Xen itself, and these are
29 # handled elsewhere.
30 .PHONY: test
31 test:
32 $(MAKE) -C tools/python test
34 # build and install everything into local dist directory
35 .PHONY: dist
36 dist: DESTDIR=$(DISTDIR)/install
37 dist: dist-xen dist-kernels dist-tools dist-stubdom dist-docs
38 $(INSTALL_DIR) $(DISTDIR)/check
39 $(INSTALL_DATA) ./COPYING $(DISTDIR)
40 $(INSTALL_DATA) ./README $(DISTDIR)
41 $(INSTALL_PROG) ./install.sh $(DISTDIR)
42 $(INSTALL_PROG) tools/check/chk tools/check/check_* tools/check/funcs.sh $(DISTDIR)/check
43 dist-%: DESTDIR=$(DISTDIR)/install
44 dist-%: install-%
45 @: # do nothing
47 # Legacy dist targets
48 .PHONY: xen tools stubdom kernels docs
49 xen: dist-xen
50 tools: dist-tools
51 kernels: dist-kernels
52 stubdom: dist-stubdom
53 docs: dist-docs
55 .PHONY: prep-kernels
56 prep-kernels:
57 for i in $(XKERNELS) ; do $(MAKE) $$i-prep || exit 1; done
59 .PHONY: install-xen
60 install-xen:
61 $(MAKE) -C xen install
63 .PHONY: install-tools
64 install-tools:
65 $(MAKE) -C tools install
67 .PHONY: install-kernels
68 install-kernels:
69 for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
71 .PHONY: install-stubdom
72 install-stubdom:
73 $(MAKE) -C stubdom install
75 .PHONY: install-docs
76 install-docs:
77 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
79 .PHONY: dev-docs
80 dev-docs:
81 $(MAKE) -C docs dev-docs
83 # Build all the various kernels and modules
84 .PHONY: kbuild
85 kbuild: kernels
87 # Delete the kernel build trees entirely
88 .PHONY: kdelete
89 kdelete:
90 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
92 # Clean the kernel build trees
93 .PHONY: kclean
94 kclean:
95 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
97 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
98 # and place them in the install directory. 'make install' should then
99 # copy them to the normal system directories
100 .PHONY: world
101 world:
102 $(MAKE) clean
103 $(MAKE) kdelete
104 $(MAKE) dist
106 # clean doesn't do a kclean
107 .PHONY: clean
108 clean::
109 $(MAKE) -C xen clean
110 $(MAKE) -C tools clean
111 $(MAKE) -C stubdom crossclean
112 $(MAKE) -C docs clean
114 # clean, but blow away kernel build tree plus tarballs
115 .PHONY: distclean
116 distclean:
117 $(MAKE) -C xen distclean
118 $(MAKE) -C tools distclean
119 $(MAKE) -C stubdom distclean
120 $(MAKE) -C docs distclean
121 rm -rf dist patches/tmp
122 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
123 rm -rf patches/*/.makedep
125 # Linux name for GNU distclean
126 .PHONY: mrproper
127 mrproper: distclean
129 # Prepare for source tarball
130 .PHONY: src-tarball
131 src-tarball: distclean
132 $(MAKE) -C xen .banner
133 rm -rf xen/tools/figlet .[a-z]*
134 $(MAKE) -C xen distclean
136 .PHONY: help
137 help:
138 @echo 'Installation targets:'
139 @echo ' install - build and install everything'
140 @echo ' install-xen - build and install the Xen hypervisor'
141 @echo ' install-tools - build and install the control tools'
142 @echo ' install-kernels - build and install guest kernels'
143 @echo ' install-stubdom - build and install the stubdomain images'
144 @echo ' install-docs - build and install user documentation'
145 @echo ''
146 @echo 'Building targets:'
147 @echo ' dist - build and install everything into local dist directory'
148 @echo ' world - clean everything, delete guest kernel build'
149 @echo ' trees then make dist'
150 @echo ' xen - build and install Xen hypervisor'
151 @echo ' tools - build and install tools'
152 @echo ' stubdomain - build and install the stubdomain images'
153 @echo ' kernels - build and install guest kernels'
154 @echo ' kbuild - synonym for make kernels'
155 @echo ' docs - build and install user documentation'
156 @echo ' dev-docs - build developer-only documentation'
157 @echo ''
158 @echo 'Cleaning targets:'
159 @echo ' clean - clean the Xen, tools and docs (but not guest kernel trees)'
160 @echo ' distclean - clean plus delete kernel build trees and'
161 @echo ' local downloaded files'
162 @echo ' kdelete - delete guest kernel build trees'
163 @echo ' kclean - clean guest kernel build trees'
164 @echo ''
165 @echo 'Miscellaneous targets:'
166 @echo ' prep-kernels - prepares kernel directories, does not build'
167 @echo ' uninstall - attempt to remove installed Xen tools'
168 @echo ' (use with extreme care!)'
169 @echo
170 @echo 'Trusted Boot (tboot) targets:'
171 @echo ' build-tboot - download and build the tboot module'
172 @echo ' install-tboot - download, build, and install the tboot module'
173 @echo ' clean-tboot - clean the tboot module if it exists'
174 @echo
175 @echo 'Environment:'
176 @echo ' XEN_PYTHON_NATIVE_INSTALL=y'
177 @echo ' - native python install or dist'
178 @echo ' install into prefix/lib/python<VERSION>'
179 @echo ' instead of <PREFIX>/lib/python'
180 @echo ' true if set to non-empty value, false otherwise'
182 # Use this target with extreme care!
183 .PHONY: uninstall
184 uninstall: D=$(DESTDIR)
185 uninstall:
186 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date +%s` || true
187 rm -rf $(D)/etc/init.d/xend*
188 rm -rf $(D)/etc/hotplug/xen-backend.agent
189 rm -f $(D)/etc/udev/rules.d/xen-backend.rules
190 rm -f $(D)/etc/udev/xen-backend.rules
191 rm -f $(D)/etc/sysconfig/xendomains
192 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
193 rm -rf $(D)/boot/*xen*
194 rm -rf $(D)/lib/modules/*xen*
195 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/lomount
196 rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
197 rm -rf $(D)/usr/bin/xc_shadow
198 rm -rf $(D)/usr/bin/pygrub
199 rm -rf $(D)/usr/bin/setsize $(D)/usr/bin/tbctl
200 rm -rf $(D)/usr/bin/xsls
201 rm -rf $(D)/usr/include/xenctrl.h $(D)/usr/include/xenguest.h
202 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
203 rm -rf $(D)/usr/include/xen
204 rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
205 rm -rf $(D)$(LIBDIR)/libxenstore*
206 rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
207 rm -rf $(D)$(LIBDIR)/xen/
208 rm -rf $(D)/usr/lib/xen/
209 rm -rf $(D)/usr/local/sbin/setmask $(D)/usr/local/sbin/xen*
210 rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
211 rm -rf $(D)/usr/share/doc/xen
212 rm -rf $(D)/usr/share/xen
213 rm -rf $(D)/usr/share/man/man1/xen*
214 rm -rf $(D)/usr/share/man/man8/xen*
215 rm -rf $(D)/boot/tboot*
217 # Legacy targets for compatibility
218 .PHONY: linux26
219 linux26:
220 $(MAKE) 'KERNELS=linux-2.6*' kernels
223 #
224 # tboot targets
225 #
227 TBOOT_TARFILE = tboot-20080613.tar.gz
228 TBOOT_BASE_URL = http://downloads.sourceforge.net/tboot
230 .PHONY: build-tboot
231 build-tboot: download_tboot
232 $(MAKE) -C tboot build
234 .PHONY: install-tboot
235 install-tboot: download_tboot
236 $(MAKE) -C tboot install
238 .PHONY: dist-tboot
239 dist-tboot: download_tboot
240 $(MAKE) DESTDIR=$(DISTDIR)/install -C tboot dist
242 .PHONY: clean-tboot
243 clean-tboot:
244 [ ! -d tboot ] || $(MAKE) -C tboot clean
246 .PHONY: distclean-tboot
247 distclean-tboot:
248 [ ! -d tboot ] || $(MAKE) -C tboot distclean
250 .PHONY: download_tboot
251 download_tboot: tboot/Makefile
253 tboot/Makefile: tboot/$(TBOOT_TARFILE)
254 [ -e tboot/Makefile ] || tar -xzf tboot/$(TBOOT_TARFILE) -C tboot/ --strip-components 1
256 tboot/$(TBOOT_TARFILE):
257 mkdir -p tboot
258 wget -O tboot/$(TBOOT_TARFILE) $(TBOOT_BASE_URL)/$(TBOOT_TARFILE)