ia64/xen-unstable

view Makefile @ 17838:e5c9c8e6e726

tools: replace sprintf with snprintf where applicable

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