debuggers.hg

view Makefile @ 3588:a26c121cabd0

bitkeeper revision 1.1159.231.2 (41f8c846X6nmyCraD342rP9SirCaqg)

Merge scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Thu Jan 27 10:53:58 2005 +0000 (2005-01-27)
parents 1b6a9577c36d dca8a77a487d
children f20cf55e3557
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 ?= *2.6*
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 ($(ARCH),)
26 export TARGET_SUBARCH := $(ARCH)
27 export SUBARCH := $(subst x86_32,i386,$(ARCH))
28 endif
30 include buildconfigs/Rules.mk
32 .PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper
33 .PHONY: kbuild kdelete kclean install-tools install-xen install-docs
34 .PHONY: install-kernels
36 all: dist
38 # install everything into the standard system directories
39 # NB: install explicitly does not check that everything is up to date!
40 install: DESTDIR=
41 install: xen checked-tools kernels docs
43 # Only check for install req'mts on 'make install', not on 'make dist'.
44 checked-tools:
45 $(MAKE) ARCH=$(ARCH) -C tools/check install
46 $(MAKE) ARCH=$(ARCH) -C tools install
48 # build and install everything into local dist directory
49 dist: xen tools kernels 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
56 xen:
57 $(MAKE) -C xen install
59 tools:
60 $(MAKE) ARCH=$(ARCH) -C tools install
62 kernels:
63 for i in $(XKERNELS) ; do $(MAKE) $$i-build || exit 1; done
65 docs:
66 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
68 # Build all the various kernels and modules
69 kbuild: kernels
71 # Delete the kernel build trees entirely
72 kdelete:
73 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
75 # Clean the kernel build trees
76 kclean:
77 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
79 # Make patches from kernel sparse trees
80 mkpatches:
81 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch || exit 1; done
84 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
85 # and place them in the install directory. 'make install' should then
86 # copy them to the normal system directories
87 world:
88 $(MAKE) clean
89 $(MAKE) kdelete
90 $(MAKE) dist
92 # clean doesn't do a kclean
93 clean:
94 $(MAKE) -C xen clean
95 $(MAKE) ARCH=$(ARCH) -C tools clean
96 $(MAKE) -C docs clean
98 # clean, but blow away kernel build tree plus tar balls
99 mrproper: clean
100 rm -rf dist patches/tmp
101 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
102 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
104 install-twisted:
105 wget http://www.twistedmatrix.com/products/get-current.epy
106 tar -zxf Twisted-*.tar.gz
107 cd Twisted-* && python setup.py install
109 install-logging: LOGGING=logging-0.4.9.2
110 install-logging:
111 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
112 tar -zxf $(LOGGING).tar.gz
113 cd $(LOGGING) && python setup.py install
115 # handy target to upgrade iptables (use rpm or apt-get in preference)
116 install-iptables:
117 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
118 tar -jxf iptables-1.2.11.tar.bz2
119 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
121 help:
122 @echo 'Installation targets:'
123 @echo ' install - build and install everything'
124 @echo ''
125 @echo 'Building targets:'
126 @echo ' dist - build and install everything into local dist directory'
127 @echo ' world - clean everything, delete guest kernel build'
128 @echo ' trees then make dist'
129 @echo ' xen - build and install Xen hypervisor'
130 @echo ' tools - build and install tools'
131 @echo ' kernels - build and install guest kernels'
132 @echo ' kbuild - synonym for make kernels'
133 @echo ' docs - build and install docs'
134 @echo ''
135 @echo 'Cleaning targets:'
136 @echo ' clean - clean the Xen, tools and docs (but not'
137 @echo ' guest kernel) trees'
138 @echo ' mrproper - clean plus delete kernel tarballs and kernel'
139 @echo ' build trees'
140 @echo ' kdelete - delete guest kernel build trees'
141 @echo ' kclean - clean guest kernel build trees'
142 @echo ''
143 @echo 'Dependency installation targets:'
144 @echo ' install-twisted - install the Twisted Matrix Framework'
145 @echo ' install-logging - install the Python Logging package'
146 @echo ' install-iptables - install iptables tools'
147 @echo ''
148 @echo 'Miscellaneous targets:'
149 @echo ' mkpatches - make patches against vanilla kernels from'
150 @echo ' sparse trees'
151 @echo ' uninstall - attempt to remove installed Xen tools (use'
152 @echo ' with extreme care!)'
154 # Use this target with extreme care!
155 uninstall: DESTDIR=
156 uninstall: D=$(DESTDIR)
157 uninstall:
158 [ ! -d $(D)/etc/xen ] || mv -f $(D)/etc/xen $(D)/etc/xen.old
159 rm -rf $(D)/etc/init.d/xend*
160 rm -rf $(D)/usr/lib/libxc* $(D)/usr/lib/libxutil*
161 rm -rf $(D)/usr/lib/python/xen $(D)/usr/include/xen
162 rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
163 rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
164 rm -rf $(D)/usr/sbin/netfix
165 rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm $(D)/var/lib/xen
166 rm -rf $(D)/usr/share/doc/xen $(D)/usr/man/man*/xentrace*
167 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/miniterm
168 rm -rf $(D)/boot/*xen*
170 # Legacy targets for compatibility
171 linux24:
172 $(MAKE) linux-2.4-xen0-build
173 $(MAKE) linux-2.4-xenU-build
175 linux26:
176 $(MAKE) linux-2.6-xen0-build
177 $(MAKE) linux-2.6-xenU-build
179 netbsd20:
180 $(MAKE) netbsd-2.0-xenU-build