ia64/xen-unstable

view Makefile @ 4837:e2f39ab492f6

bitkeeper revision 1.1389.15.4 (4280e2e1TW-3Y8iE13utT8fyuaozWA)

Cset exclude: kaf24@firebug.cl.cam.ac.uk|ChangeSet|20050510144837|42684
author kaf24@firebug.cl.cam.ac.uk
date Tue May 10 16:35:45 2005 +0000 (2005-05-10)
parents 8d23fe716501
children 1c0f716646d1 bb2558cbc4f8
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 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
19 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
20 XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
22 export DESTDIR
24 # Export target architecture overrides to Xen and Linux sub-trees.
25 ifneq ($(XEN_TARGET_ARCH),)
26 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
27 export XEN_TARGET_ARCH SUBARCH
28 endif
30 include Config.mk
31 include buildconfigs/Rules.mk
33 .PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper
34 .PHONY: kbuild kdelete kclean
36 all: dist
38 # build and install everything into the standard system directories
39 install: install-xen install-tools install-kernels install-docs
41 build: kernels
42 $(MAKE) -C xen build
43 $(MAKE) -C tools build
44 $(MAKE) -C docs build
46 # build and install everything into local dist directory
47 dist: xen tools kernels docs
48 $(INSTALL_DIR) $(DISTDIR)/check
49 $(INSTALL_DATA) ./COPYING $(DISTDIR)
50 $(INSTALL_DATA) ./README $(DISTDIR)
51 $(INSTALL_PROG) ./install.sh $(DISTDIR)
52 $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DISTDIR)/check
54 xen:
55 $(MAKE) -C xen install
57 tools:
58 $(MAKE) -C tools install
60 kernels:
61 for i in $(XKERNELS) ; do $(MAKE) $$i-build || exit 1; done
63 docs:
64 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
66 # Build all the various kernels and modules
67 kbuild: kernels
69 # Delete the kernel build trees entirely
70 kdelete:
71 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
73 # Clean the kernel build trees
74 kclean:
75 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
77 # Make patches from kernel sparse trees
78 mkpatches:
79 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch; done
81 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
82 # and place them in the install directory. 'make install' should then
83 # copy them to the normal system directories
84 world:
85 $(MAKE) clean
86 $(MAKE) kdelete
87 $(MAKE) dist
89 # clean doesn't do a kclean
90 clean:
91 $(MAKE) -C xen clean
92 $(MAKE) -C tools clean
93 $(MAKE) -C docs clean
95 # clean, but blow away kernel build tree plus tar balls
96 mrproper: clean
97 rm -rf dist patches/tmp
98 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
99 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
101 install-twisted:
102 wget http://www.twistedmatrix.com/products/get-current.epy
103 tar -zxf Twisted-*.tar.gz
104 cd Twisted-* && python setup.py install
106 install-logging: LOGGING=logging-0.4.9.2
107 install-logging:
108 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
109 tar -zxf $(LOGGING).tar.gz
110 cd $(LOGGING) && python setup.py install
112 # handy target to upgrade iptables (use rpm or apt-get in preference)
113 install-iptables:
114 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
115 tar -jxf iptables-1.2.11.tar.bz2
116 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
118 install-%: DESTDIR=
119 install-%: %
120 @: # do nothing
122 help:
123 @echo 'Installation targets:'
124 @echo ' install - build and install everything'
125 @echo ' install-xen - build and install the Xen hypervisor'
126 @echo ' install-tools - build and install the control tools'
127 @echo ' install-kernels - build and install guest kernels'
128 @echo ' install-docs - build and install documentation'
129 @echo ''
130 @echo 'Building targets:'
131 @echo ' dist - build and install everything into local dist directory'
132 @echo ' world - clean everything, delete guest kernel build'
133 @echo ' trees then make dist'
134 @echo ' xen - build and install Xen hypervisor'
135 @echo ' tools - build and install tools'
136 @echo ' kernels - build and install guest kernels'
137 @echo ' kbuild - synonym for make kernels'
138 @echo ' docs - build and install docs'
139 @echo ''
140 @echo 'Cleaning targets:'
141 @echo ' clean - clean the Xen, tools and docs (but not'
142 @echo ' guest kernel) trees'
143 @echo ' mrproper - clean plus delete kernel tarballs and kernel'
144 @echo ' build trees'
145 @echo ' kdelete - delete guest kernel build trees'
146 @echo ' kclean - clean guest kernel build trees'
147 @echo ''
148 @echo 'Dependency installation targets:'
149 @echo ' install-twisted - install the Twisted Matrix Framework'
150 @echo ' install-logging - install the Python Logging package'
151 @echo ' install-iptables - install iptables tools'
152 @echo ''
153 @echo 'Miscellaneous targets:'
154 @echo ' mkpatches - make patches against vanilla kernels from'
155 @echo ' sparse trees'
156 @echo ' uninstall - attempt to remove installed Xen tools (use'
157 @echo ' with extreme care!)'
159 # Use this target with extreme care!
160 uninstall: DESTDIR=
161 uninstall: D=$(DESTDIR)
162 uninstall:
163 [ ! -d $(D)/etc/xen ] || mv -f $(D)/etc/xen $(D)/etc/xen.old
164 rm -rf $(D)/etc/init.d/xend*
165 rm -rf $(D)/usr/$(LIBDIR)/libxc* $(D)/usr/$(LIBDIR)/libxutil*
166 rm -rf $(D)/usr/lib/python/xen $(D)/usr/include/xen
167 rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
168 rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
169 rm -rf $(D)/usr/sbin/netfix
170 rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm $(D)/var/lib/xen
171 rm -rf $(D)/usr/share/doc/xen $(D)/usr/man/man*/xentrace*
172 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/miniterm
173 rm -rf $(D)/boot/*xen*
174 rm -rf $(D)/lib/modules/*xen*
176 # Legacy targets for compatibility
177 linux24:
178 $(MAKE) linux-2.4-xen0-build
179 $(MAKE) linux-2.4-xenU-build
181 linux26:
182 $(MAKE) linux-2.6-xen0-build
183 $(MAKE) linux-2.6-xenU-build
185 netbsd20:
186 $(MAKE) netbsd-2.0-xenU-build