ia64/xen-unstable

view Makefile @ 9830:9a5bc502a77a

This patch adds a policy name to the policy definition. This policy name
must be unique and must change if the content of the file changes. The
policy name is used to ensure that the XM tools and the hypervisor work
on the same policy, i.e., interpret the security information on domains
consistently. This patch also simplifies the policy management by moving
policy and labels into a single file.

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