ia64/xen-unstable

view Makefile @ 6228:451669097ffd

Another tweak to the network-bridge script.
Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Wed Aug 17 12:29:34 2005 +0000 (2005-08-17)
parents c66cac10524a
children 7733176cc821 6721abf6b16d f51fe43c5d1c 6783e59e1c45 c589ca6d292b 40b887fa79d0 29aab159846c 1ae656509f02 23979fb12c49 84ee014ebd41 99914b54f7bf 81576d3d1ca8
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 tools kernels docs world clean mkpatches mrproper
39 .PHONY: kbuild kdelete kclean
41 # build and install everything into the standard system directories
42 install: install-xen install-tools install-kernels 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 tools kernels 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 # Build all the various kernels and modules
70 kbuild: kernels
72 # Delete the kernel build trees entirely
73 kdelete:
74 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
76 # Clean the kernel build trees
77 kclean:
78 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
80 # Make patches from kernel sparse trees
81 mkpatches:
82 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch; 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) -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-logging: LOGGING=logging-0.4.9.2
105 install-logging:
106 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
107 tar -zxf $(LOGGING).tar.gz
108 cd $(LOGGING) && python setup.py install
110 # handy target to upgrade iptables (use rpm or apt-get in preference)
111 install-iptables:
112 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
113 tar -jxf iptables-1.2.11.tar.bz2
114 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
116 install-%: DESTDIR=
117 install-%: %
118 @: # do nothing
120 help:
121 @echo 'Installation targets:'
122 @echo ' install - build and install everything'
123 @echo ' install-xen - build and install the Xen hypervisor'
124 @echo ' install-tools - build and install the control tools'
125 @echo ' install-kernels - build and install guest kernels'
126 @echo ' install-docs - build and install documentation'
127 @echo ''
128 @echo 'Building targets:'
129 @echo ' dist - build and install everything into local dist directory'
130 @echo ' world - clean everything, delete guest kernel build'
131 @echo ' trees then make dist'
132 @echo ' xen - build and install Xen hypervisor'
133 @echo ' tools - build and install tools'
134 @echo ' kernels - build and install guest kernels'
135 @echo ' kbuild - synonym for make kernels'
136 @echo ' docs - build and install docs'
137 @echo ''
138 @echo 'Cleaning targets:'
139 @echo ' clean - clean the Xen, tools and docs (but not'
140 @echo ' guest kernel) trees'
141 @echo ' mrproper - clean plus delete kernel tarballs and kernel'
142 @echo ' build trees'
143 @echo ' kdelete - delete guest kernel build trees'
144 @echo ' kclean - clean guest kernel build trees'
145 @echo ''
146 @echo 'Dependency installation targets:'
147 @echo ' install-logging - install the Python Logging package'
148 @echo ' install-iptables - install iptables tools'
149 @echo ''
150 @echo 'Miscellaneous targets:'
151 @echo ' mkpatches - make patches against vanilla kernels from'
152 @echo ' sparse trees'
153 @echo ' uninstall - attempt to remove installed Xen tools (use'
154 @echo ' with extreme care!)'
156 # Use this target with extreme care!
157 uninstall: DESTDIR=
158 uninstall: D=$(DESTDIR)
159 uninstall:
160 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date +%s`
161 rm -rf $(D)/etc/init.d/xend*
162 rm -rf $(D)/usr/$(LIBDIR)/libxc* $(D)/usr/$(LIBDIR)/libxutil*
163 rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/include/xen
164 rm -rf $(D)/usr/$(LIBDIR)/share/xen $(D)/usr/$(LIBDIR)/libxenstore*
165 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
166 rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
167 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.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
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) 'KERNELS=linux-2.4*' kernels
180 linux26:
181 $(MAKE) 'KERNELS=linux-2.6*' kernels
183 netbsd20:
184 $(MAKE) netbsd-2.0-xenU-build