ia64/xen-unstable

view Makefile @ 19506:3fecb8f43617

tools: Add device-path command to convert SBDF into device path.

'SBDF' format is "[SEG#:]BUS#:DEV#.FUNC#"
ex) 0000:0a:1f.3
Device path format is "HID[:UID]-DEV#.FUNC#[-DEV#.FUNC#[...]]"
ex) PNP0A08:0-2.0-0.0

The command can be executed as follows.

# device_path 0a:1f.3
PNP0A08:0-2.0-0.0

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 06 13:52:56 2009 +0100 (2009-04-06)
parents 57327f3334b4
children ff9fdd6fce1e
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/udev/rules.d/xend.rules
207 rm -f $(D)/etc/udev/xend.rules
208 rm -f $(D)/etc/sysconfig/xendomains
209 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
210 rm -rf $(D)/boot/*xen*
211 rm -rf $(D)/lib/modules/*xen*
212 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/lomount
213 rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
214 rm -rf $(D)/usr/bin/xc_shadow
215 rm -rf $(D)/usr/bin/pygrub
216 rm -rf $(D)/usr/bin/setsize $(D)/usr/bin/tbctl
217 rm -rf $(D)/usr/bin/xsls
218 rm -rf $(D)/usr/include/xenctrl.h $(D)/usr/include/xenguest.h
219 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
220 rm -rf $(D)/usr/include/xen
221 rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
222 rm -rf $(D)$(LIBDIR)/libxenstore*
223 rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
224 rm -rf $(D)$(LIBDIR)/xen/
225 rm -rf $(D)/usr/lib/xen/
226 rm -rf $(D)/usr/local/sbin/setmask $(D)/usr/local/sbin/xen*
227 rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm $(D)/usr/sbin/device-path
228 rm -rf $(D)/usr/share/doc/xen
229 rm -rf $(D)/usr/share/xen
230 rm -rf $(D)/usr/share/man/man1/xen*
231 rm -rf $(D)/usr/share/man/man8/xen*
232 rm -rf $(D)/boot/tboot*
234 # Legacy targets for compatibility
235 .PHONY: linux26
236 linux26:
237 $(MAKE) 'KERNELS=linux-2.6*' kernels
240 #
241 # tboot targets
242 #
244 TBOOT_TARFILE = tboot-20080613.tar.gz
245 #TBOOT_BASE_URL = http://downloads.sourceforge.net/tboot
246 TBOOT_BASE_URL = $(XEN_EXTFILES_URL)
248 .PHONY: build-tboot
249 build-tboot: download_tboot
250 $(MAKE) -C tboot build
252 .PHONY: install-tboot
253 install-tboot: download_tboot
254 $(MAKE) -C tboot install
256 .PHONY: dist-tboot
257 dist-tboot: download_tboot
258 $(MAKE) DESTDIR=$(DISTDIR)/install -C tboot dist
260 .PHONY: clean-tboot
261 clean-tboot:
262 [ ! -d tboot ] || $(MAKE) -C tboot clean
264 .PHONY: distclean-tboot
265 distclean-tboot:
266 [ ! -d tboot ] || $(MAKE) -C tboot distclean
268 .PHONY: download_tboot
269 download_tboot: tboot/Makefile
271 tboot/Makefile: tboot/$(TBOOT_TARFILE)
272 [ -e tboot/Makefile ] || tar -xzf tboot/$(TBOOT_TARFILE) -C tboot/ --strip-components 1
274 tboot/$(TBOOT_TARFILE):
275 mkdir -p tboot
276 wget -O tboot/$(TBOOT_TARFILE) $(TBOOT_BASE_URL)/$(TBOOT_TARFILE)