ia64/xen-unstable

view Makefile @ 3541:71a2a8ee7f0b

bitkeeper revision 1.1159.223.41 (41f68883FaU7hVfFtWiOkCPnI6N1Hw)

Fix root Makefile so that targets only install to / if you do a
'make install'. All other targets will install to local dist directory,
as before.
author kaf24@scramble.cl.cam.ac.uk
date Tue Jan 25 17:57:23 2005 +0000 (2005-01-25)
parents 5c6d547e4e59
children bbfc7fe2e910 eeb8b544bff5
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 linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-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 include buildconfigs/Rules.mk
26 .PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper
27 .PHONY: kbuild kdelete kclean install-tools install-xen install-docs
28 .PHONY: install-kernels
30 all: dist
32 # install everything into the standard system directories
33 # NB: install explicitly does not check that everything is up to date!
34 install: DESTDIR=
35 install: xen checked-tools kernels docs
37 # Only check for install req'mts on 'make install', not on 'make dist'.
38 checked-tools:
39 $(MAKE) -C tools/check install
40 $(MAKE) -C tools install
42 # build and install everything into local dist directory
43 dist: xen tools kernels docs
44 $(INSTALL_DIR) $(DISTDIR)/check
45 $(INSTALL_DATA) ./COPYING $(DISTDIR)
46 $(INSTALL_DATA) ./README $(DISTDIR)
47 $(INSTALL_PROG) ./install.sh $(DISTDIR)
48 $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DISTDIR)/check
50 xen:
51 $(MAKE) -C xen install
53 tools:
54 $(MAKE) -C tools install
56 kernels:
57 for i in $(XKERNELS) ; do $(MAKE) $$i-build || exit 1; done
59 docs:
60 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
62 # Build all the various kernels and modules
63 kbuild: kernels
65 # Delete the kernel build trees entirely
66 kdelete:
67 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
69 # Clean the kernel build trees
70 kclean:
71 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
73 # Make patches from kernel sparse trees
74 mkpatches:
75 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch || exit 1; done
78 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
79 # and place them in the install directory. 'make install' should then
80 # copy them to the normal system directories
81 world:
82 $(MAKE) clean
83 $(MAKE) kdelete
84 $(MAKE) dist
86 # clean doesn't do a kclean
87 clean:
88 $(MAKE) -C xen clean
89 $(MAKE) -C tools clean
90 $(MAKE) -C docs clean
92 # clean, but blow away kernel build tree plus tar balls
93 mrproper: clean
94 rm -rf dist patches/tmp
95 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
96 for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
98 install-twisted:
99 wget http://www.twistedmatrix.com/products/get-current.epy
100 tar -zxf Twisted-*.tar.gz
101 cd Twisted-* && python setup.py install
103 install-logging: LOGGING=logging-0.4.9.2
104 install-logging:
105 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
106 tar -zxf $(LOGGING).tar.gz
107 cd $(LOGGING) && python setup.py install
109 # handy target to upgrade iptables (use rpm or apt-get in preference)
110 install-iptables:
111 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
112 tar -jxf iptables-1.2.11.tar.bz2
113 $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
115 help:
116 @echo 'Installation targets:'
117 @echo ' install - build and install everything'
118 @echo ''
119 @echo 'Building targets:'
120 @echo ' dist - build and install everything into local dist directory'
121 @echo ' world - clean everything, delete guest kernel build'
122 @echo ' trees then make dist'
123 @echo ' xen - build and install Xen hypervisor'
124 @echo ' tools - build and install tools'
125 @echo ' kernels - build and install guest kernels'
126 @echo ' kbuild - synonym for make kernels'
127 @echo ' docs - build and install docs'
128 @echo ''
129 @echo 'Cleaning targets:'
130 @echo ' clean - clean the Xen, tools and docs (but not'
131 @echo ' guest kernel) trees'
132 @echo ' mrproper - clean plus delete kernel tarballs and kernel'
133 @echo ' build trees'
134 @echo ' kdelete - delete guest kernel build trees'
135 @echo ' kclean - clean guest kernel build trees'
136 @echo ''
137 @echo 'Dependency installation targets:'
138 @echo ' install-twisted - install the Twisted Matrix Framework'
139 @echo ' install-logging - install the Python Logging package'
140 @echo ' install-iptables - install iptables tools'
141 @echo ''
142 @echo 'Miscellaneous targets:'
143 @echo ' mkpatches - make patches against vanilla kernels from'
144 @echo ' sparse trees'
145 @echo ' uninstall - attempt to remove installed Xen tools (use'
146 @echo ' with extreme care!)'
148 # Use this target with extreme care!
149 uninstall:
150 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
151 rm -rf "/usr/lib/python2.?/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.?/site-packages/Xc*"
153 # Legacy targets for compatibility
154 linux24:
155 $(MAKE) linux-2.4-xen0-build
156 $(MAKE) linux-2.4-xenU-build
158 linux26:
159 $(MAKE) linux-2.6-xen0-build
160 $(MAKE) linux-2.6-xenU-build
162 netbsd20:
163 $(MAKE) netbsd-2.0-xenU-build