ia64/xen-unstable

view Makefile @ 7184:fc97109eb28e

Remove the reason code from the destroy action -- the reason is only of value
on a graceful shutdown. Clarify the semantic difference between poweroff and
halt (we use halt to mean 'shutdown and stop' and poweroff to mean 'shutdown
and do whatever the configured behaviour is').

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Mon Oct 03 16:39:19 2005 +0100 (2005-10-03)
parents ef9591d03fdd
children 93e27f7ca8a8 61b3b357d827 aad1d3e231ff
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 # Default is to install to local 'dist' directory.
6 DISTDIR ?= $(CURDIR)/dist
7 DESTDIR ?= $(DISTDIR)/install
9 INSTALL := install
10 INSTALL_DIR := $(INSTALL) -d -m0755
11 INSTALL_DATA := $(INSTALL) -m0644
12 INSTALL_PROG := $(INSTALL) -m0755
14 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
15 # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
16 # You may use wildcards in the above e.g. KERNELS=*2.4*
18 XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
20 export DESTDIR
22 # Export target architecture overrides to Xen and Linux sub-trees.
23 ifneq ($(XEN_TARGET_ARCH),)
24 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
25 export XEN_TARGET_ARCH SUBARCH
26 endif
28 # Default target must appear before any include lines
29 all: dist
31 include Config.mk
32 include buildconfigs/Rules.mk
34 ifeq ($(XEN_TARGET_X86_PAE),y)
35 export pae=y
36 endif
38 .PHONY: all dist install xen kernels tools dev-docs docs world clean
39 .PHONY: mkpatches mrproper kbuild kdelete kclean
41 # build and install everything into the standard system directories
42 install: install-xen install-kernels install-tools install-docs
44 build: kernels
45 $(MAKE) -C xen build
46 $(MAKE) -C tools build
47 $(MAKE) -C docs build
49 # build and install everything into local dist directory
50 dist: xen kernels tools docs
51 $(INSTALL_DIR) $(DISTDIR)/check
52 $(INSTALL_DATA) ./COPYING $(DISTDIR)
53 $(INSTALL_DATA) ./README $(DISTDIR)
54 $(INSTALL_PROG) ./install.sh $(DISTDIR)
55 $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DISTDIR)/check
57 xen:
58 $(MAKE) -C xen install
60 tools:
61 $(MAKE) -C tools install
63 kernels:
64 for i in $(XKERNELS) ; do $(MAKE) $$i-build || exit 1; done
66 docs:
67 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
69 dev-docs:
70 $(MAKE) -C docs dev-docs
72 # Build all the various kernels and modules
73 kbuild: kernels
75 # Delete the kernel build trees entirely
76 kdelete:
77 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
79 # Clean the kernel build trees
80 kclean:
81 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
83 # Make patches from kernel sparse trees
84 mkpatches:
85 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch; done
87 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
88 # and place them in the install directory. 'make install' should then
89 # copy them to the normal system directories
90 world:
91 $(MAKE) clean
92 $(MAKE) kdelete
93 $(MAKE) dist
95 # clean doesn't do a kclean
96 clean::
97 $(MAKE) -C xen clean
98 $(MAKE) -C tools clean
99 $(MAKE) -C docs clean
101 # clean, but blow away kernel build tree plus tarballs
102 distclean: clean
103 rm -rf dist patches/tmp
104 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
105 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
107 # Linux name for GNU distclean
108 mrproper: distclean
110 install-logging: LOGGING=logging-0.4.9.2
111 install-logging:
112 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
113 tar -zxf $(LOGGING).tar.gz
114 cd $(LOGGING) && python setup.py install
116 # handy target to upgrade iptables (use rpm or apt-get in preference)
117 install-iptables:
118 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
119 tar -jxf iptables-1.2.11.tar.bz2
120 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
122 install-%: DESTDIR=
123 install-%: %
124 @: # do nothing
126 help:
127 @echo 'Installation targets:'
128 @echo ' install - build and install everything'
129 @echo ' install-xen - build and install the Xen hypervisor'
130 @echo ' install-tools - build and install the control tools'
131 @echo ' install-kernels - build and install guest kernels'
132 @echo ' install-docs - build and install user documentation'
133 @echo ''
134 @echo 'Building targets:'
135 @echo ' dist - build and install everything into local dist directory'
136 @echo ' world - clean everything, delete guest kernel build'
137 @echo ' trees then make dist'
138 @echo ' xen - build and install Xen hypervisor'
139 @echo ' tools - build and install tools'
140 @echo ' kernels - build and install guest kernels'
141 @echo ' kbuild - synonym for make kernels'
142 @echo ' docs - build and install user documentation'
143 @echo ' dev-docs - build developer-only documentation'
144 @echo ''
145 @echo 'Cleaning targets:'
146 @echo ' clean - clean the Xen, tools and docs (but not'
147 @echo ' guest kernel) trees'
148 @echo ' distclean - clean plus delete kernel tarballs and kernel'
149 @echo ' build trees'
150 @echo ' kdelete - delete guest kernel build trees'
151 @echo ' kclean - clean guest kernel build trees'
152 @echo ''
153 @echo 'Dependency installation targets:'
154 @echo ' install-logging - install the Python Logging package'
155 @echo ' install-iptables - install iptables tools'
156 @echo ''
157 @echo 'Miscellaneous targets:'
158 @echo ' mkpatches - make patches against vanilla kernels from'
159 @echo ' sparse trees'
160 @echo ' uninstall - attempt to remove installed Xen tools (use'
161 @echo ' with extreme care!)'
163 # Use this target with extreme care!
164 uninstall: DESTDIR=
165 uninstall: D=$(DESTDIR)
166 uninstall:
167 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date +%s` || true
168 rm -rf $(D)/etc/init.d/xend*
169 rm -rf $(D)/etc/hotplug/xen-backend.agent
170 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
171 rm -rf $(D)/boot/*xen*
172 rm -rf $(D)/lib/modules/*xen*
173 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/lomount
174 rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
175 rm -rf $(D)/usr/bin/xc_shadow
176 rm -rf $(D)/usr/include/xenctrl.h
177 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
178 rm -rf $(D)/usr/include/xen
179 rm -rf $(D)/usr/$(LIBDIR)/libxenctrl* $(D)/usr/$(LIBDIR)/libxenguest*
180 rm -rf $(D)/usr/$(LIBDIR)/libxenstore*
181 rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/$(LIBDIR)/xen
182 rm -rf $(D)/usr/libexec/xen
183 rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
184 rm -rf $(D)/usr/share/doc/xen
185 rm -rf $(D)/usr/share/xen
186 rm -rf $(D)/usr/share/man/man1/xen*
187 rm -rf $(D)/usr/share/man/man8/xen*
189 # Legacy targets for compatibility
190 linux24:
191 $(MAKE) 'KERNELS=linux-2.4*' kernels
193 linux26:
194 $(MAKE) 'KERNELS=linux-2.6*' kernels
196 netbsd20:
197 $(MAKE) netbsd-2.0-xenU-build