ia64/xen-unstable

view Makefile @ 9706:3c05406f5e0a

In some cases, say for instance for some bizzare reason
the tree was checked out of CVS, which doens't neccessarily
store file permissions, mkbuildtree may not be executable.
So run them explicitly via bash.

Signed-Off-By: Horms <horms@verge.net.au>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 13 11:24:00 2006 +0100 (2006-04-13)
parents b454a09cddb1
children 9a5bc502a77a 0ec4b9dfd5b4
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 KERNELS ?= linux-2.6-xen
6 # You may use wildcards in the above e.g. KERNELS=*2.6*
8 XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
10 # Export target architecture overrides to Xen and Linux sub-trees.
11 ifneq ($(XEN_TARGET_ARCH),)
12 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
13 export XEN_TARGET_ARCH SUBARCH XEN_SYSTYPE
14 endif
16 # Default target must appear before any include lines
17 .PHONY: all
18 all: dist
20 XEN_ROOT=$(CURDIR)
21 include Config.mk
22 include buildconfigs/Rules.mk
24 ifeq ($(XEN_TARGET_X86_PAE),y)
25 export pae=y
26 endif
28 # build and install everything into the standard system directories
29 .PHONY: install
30 install: install-xen install-kernels install-tools install-docs
32 .PHONY: build
33 build: kernels
34 $(MAKE) -C xen build
35 $(MAKE) -C tools build
36 $(MAKE) -C docs build
38 # The test target is for unit tests that can run without an installation. Of
39 # course, many tests require a machine running Xen itself, and these are
40 # handled elsewhere.
41 .PHONY: test
42 test:
43 $(MAKE) -C tools/python test
45 # build and install everything into local dist directory
46 .PHONY: dist
47 dist: DESTDIR=$(DISTDIR)/install
48 dist: dist-xen dist-kernels dist-tools dist-docs
49 $(INSTALL_DIR) $(DISTDIR)/check
50 $(INSTALL_DATA) ./COPYING $(DISTDIR)
51 $(INSTALL_DATA) ./README $(DISTDIR)
52 $(INSTALL_PROG) ./install.sh $(DISTDIR)
53 $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DISTDIR)/check
54 dist-%: DESTDIR=$(DISTDIR)/install
55 dist-%: install-%
56 @: # do nothing
58 # Legacy dist targets
59 .PHONY: xen tools kernels docs
60 xen: dist-xen
61 tools: dist-tools
62 kernels: dist-kernels
63 docs: dist-docs
65 .PHONY: prep-kernels
66 prep-kernels:
67 for i in $(XKERNELS) ; do $(MAKE) $$i-prep || exit 1; done
69 .PHONY: install-xen
70 install-xen:
71 $(MAKE) -C xen install
73 .PHONY: install-tools
74 install-tools:
75 $(MAKE) -C tools install
77 .PHONY: install-kernels
78 install-kernels:
79 for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
81 .PHONY: install-docs
82 install-docs:
83 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
85 .PHONY: dev-docs
86 dev-docs:
87 $(MAKE) -C docs dev-docs
89 # Build all the various kernels and modules
90 .PHONY: kbuild
91 kbuild: kernels
93 # Delete the kernel build trees entirely
94 .PHONY: kdelete
95 kdelete:
96 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
98 # Clean the kernel build trees
99 .PHONY: kclean
100 kclean:
101 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
103 # Make patches from kernel sparse trees
104 .PHONY: mkpatches
105 mkpatches:
106 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch; done
108 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
109 # and place them in the install directory. 'make install' should then
110 # copy them to the normal system directories
111 .PHONY: world
112 world:
113 $(MAKE) clean
114 $(MAKE) kdelete
115 $(MAKE) dist
117 # clean doesn't do a kclean
118 .PHONY: clean
119 clean::
120 $(MAKE) -C xen clean
121 $(MAKE) -C tools clean
122 $(MAKE) -C docs clean
124 # clean, but blow away kernel build tree plus tarballs
125 .PHONY: distclean
126 distclean: clean
127 rm -rf dist patches/tmp
128 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
129 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
131 # Linux name for GNU distclean
132 .PHONY: mrproper
133 mrproper: distclean
135 .PHONY: help
136 help:
137 @echo 'Installation targets:'
138 @echo ' install - build and install everything'
139 @echo ' install-xen - build and install the Xen hypervisor'
140 @echo ' install-tools - build and install the control tools'
141 @echo ' install-kernels - build and install guest kernels'
142 @echo ' install-docs - build and install user documentation'
143 @echo ''
144 @echo 'Building targets:'
145 @echo ' dist - build and install everything into local dist directory'
146 @echo ' world - clean everything, delete guest kernel build'
147 @echo ' trees then make dist'
148 @echo ' xen - build and install Xen hypervisor'
149 @echo ' tools - build and install tools'
150 @echo ' kernels - build and install guest kernels'
151 @echo ' kbuild - synonym for make kernels'
152 @echo ' docs - build and install user documentation'
153 @echo ' dev-docs - build developer-only documentation'
154 @echo ''
155 @echo 'Cleaning targets:'
156 @echo ' clean - clean the Xen, tools and docs (but not guest kernel trees)'
157 @echo ' distclean - clean plus delete kernel build trees and'
158 @echo ' local downloaded files'
159 @echo ' kdelete - delete guest kernel build trees'
160 @echo ' kclean - clean guest kernel build trees'
161 @echo ''
162 @echo 'Miscellaneous targets:'
163 @echo ' prep-kernels - prepares kernel directories, does not build'
164 @echo ' mkpatches - make patches against vanilla kernels from'
165 @echo ' sparse trees'
166 @echo ' uninstall - attempt to remove installed Xen tools'
167 @echo ' (use with extreme care!)'
168 @echo
169 @echo 'Environment:'
170 @echo ' XEN_PYTHON_NATIVE_INSTALL=y'
171 @echo ' - native python install or dist'
172 @echo ' install into prefix/lib/python<VERSION>'
173 @echo ' instead of <PREFIX>/lib/python'
174 @echo ' true if set to non-empty value, false otherwise'
176 # Use this target with extreme care!
177 .PHONY: uninstall
178 uninstall: D=$(DESTDIR)
179 uninstall:
180 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date +%s` || true
181 rm -rf $(D)/etc/init.d/xend*
182 rm -rf $(D)/etc/hotplug/xen-backend.agent
183 rm -f $(D)/etc/udev/rules.d/xen-backend.rules
184 rm -f $(D)/etc/udev/xen-backend.rules
185 rm -f $(D)/etc/sysconfig/xendomains
186 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
187 rm -rf $(D)/boot/*xen*
188 rm -rf $(D)/lib/modules/*xen*
189 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/lomount
190 rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
191 rm -rf $(D)/usr/bin/xc_shadow
192 rm -rf $(D)/usr/bin/pygrub
193 rm -rf $(D)/usr/bin/setsize $(D)/usr/bin/tbctl
194 rm -rf $(D)/usr/bin/xsls
195 rm -rf $(D)/usr/include/xenctrl.h $(D)/usr/include/xenguest.h
196 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
197 rm -rf $(D)/usr/include/xen
198 rm -rf $(D)/usr/$(LIBDIR)/libxenctrl* $(D)/usr/$(LIBDIR)/libxenguest*
199 rm -rf $(D)/usr/$(LIBDIR)/libxenstore*
200 rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/$(LIBDIR)/python/grub
201 rm -rf $(D)/usr/$(LIBDIR)/xen/
202 rm -rf $(D)/usr/lib/xen/
203 rm -rf $(D)/usr/local/sbin/setmask $(D)/usr/local/sbin/xen*
204 rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
205 rm -rf $(D)/usr/share/doc/xen
206 rm -rf $(D)/usr/share/xen
207 rm -rf $(D)/usr/share/man/man1/xen*
208 rm -rf $(D)/usr/share/man/man8/xen*
210 # Legacy targets for compatibility
211 .PHONY: linux26
212 linux26:
213 $(MAKE) 'KERNELS=linux-2.6*' kernels