ia64/xen-unstable

annotate Makefile @ 17493:b2e28707ecbb

Cache figlet output across builds, and provide src-tarball target
which creates figlet output and then deletes figlet itself (which is
not licensed under GPL).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 21 20:08:29 2008 +0100 (2008-04-21)
parents 97dd72c045a5
children b3e53e17d87a
rev   line source
kaf24@1446 1 #
kaf24@424 2 # Grand Unified Makefile for Xen.
kaf24@424 3 #
kaf24@424 4
kaf24@5199 5 # Default target must appear before any include lines
kaf24@9660 6 .PHONY: all
kaf24@5199 7 all: dist
kaf24@5199 8
kfraser@10232 9 export XEN_ROOT=$(CURDIR)
kaf24@4252 10 include Config.mk
kfraser@13463 11
kfraser@13463 12 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
kfraser@13463 13 export XEN_TARGET_ARCH SUBARCH XEN_SYSTYPE
kaf24@2978 14 include buildconfigs/Rules.mk
iap10@2835 15
kaf24@5769 16 ifeq ($(XEN_TARGET_X86_PAE),y)
kaf24@5769 17 export pae=y
kaf24@5769 18 endif
kaf24@5769 19
cl349@3561 20 # build and install everything into the standard system directories
kaf24@9660 21 .PHONY: install
shand@6575 22 install: install-xen install-kernels install-tools install-docs
iap10@3514 23
kaf24@9660 24 .PHONY: build
ian@13740 25 build: kernels
doogie@4109 26 $(MAKE) -C xen build
doogie@4109 27 $(MAKE) -C tools build
doogie@4109 28 $(MAKE) -C docs build
doogie@4109 29
emellor@7244 30 # The test target is for unit tests that can run without an installation. Of
emellor@7244 31 # course, many tests require a machine running Xen itself, and these are
emellor@7244 32 # handled elsewhere.
kaf24@9660 33 .PHONY: test
emellor@7244 34 test:
emellor@7244 35 $(MAKE) -C tools/python test
emellor@7244 36
iap10@2836 37 # build and install everything into local dist directory
kaf24@9660 38 .PHONY: dist
kaf24@7225 39 dist: DESTDIR=$(DISTDIR)/install
kaf24@7225 40 dist: dist-xen dist-kernels dist-tools dist-docs
iap10@3534 41 $(INSTALL_DIR) $(DISTDIR)/check
iap10@3534 42 $(INSTALL_DATA) ./COPYING $(DISTDIR)
iap10@3534 43 $(INSTALL_DATA) ./README $(DISTDIR)
iap10@3534 44 $(INSTALL_PROG) ./install.sh $(DISTDIR)
keir@16892 45 $(INSTALL_PROG) tools/check/chk tools/check/check_* tools/check/funcs.sh $(DISTDIR)/check
kaf24@7225 46 dist-%: DESTDIR=$(DISTDIR)/install
kaf24@7225 47 dist-%: install-%
kaf24@7225 48 @: # do nothing
cl349@2443 49
kaf24@7225 50 # Legacy dist targets
kaf24@9660 51 .PHONY: xen tools kernels docs
kaf24@7225 52 xen: dist-xen
kaf24@7225 53 tools: dist-tools
kaf24@7225 54 kernels: dist-kernels
kaf24@7225 55 docs: dist-docs
kaf24@7225 56
kaf24@9660 57 .PHONY: prep-kernels
vhanquez@8312 58 prep-kernels:
vhanquez@8312 59 for i in $(XKERNELS) ; do $(MAKE) $$i-prep || exit 1; done
vhanquez@8312 60
kaf24@9660 61 .PHONY: install-xen
ian@13740 62 install-xen:
kaf24@3537 63 $(MAKE) -C xen install
iap10@2842 64
kaf24@9660 65 .PHONY: install-tools
ian@13740 66 install-tools:
kaf24@3551 67 $(MAKE) -C tools install
iap10@2842 68
kaf24@9660 69 .PHONY: install-kernels
kaf24@7225 70 install-kernels:
kaf24@7313 71 for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
cl349@2443 72
kaf24@9660 73 .PHONY: install-docs
kaf24@7225 74 install-docs:
kaf24@3537 75 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
iap10@2842 76
kaf24@9660 77 .PHONY: dev-docs
ewan@6783 78 dev-docs:
ewan@6783 79 $(MAKE) -C docs dev-docs
ewan@6783 80
kaf24@2978 81 # Build all the various kernels and modules
kaf24@9660 82 .PHONY: kbuild
cl349@2858 83 kbuild: kernels
cl349@2858 84
iap10@2842 85 # Delete the kernel build trees entirely
kaf24@9660 86 .PHONY: kdelete
iap10@3514 87 kdelete:
iap10@3514 88 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
iap10@2842 89
iap10@2842 90 # Clean the kernel build trees
kaf24@9660 91 .PHONY: kclean
iap10@3514 92 kclean:
iap10@3514 93 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
cl349@2443 94
iap10@1468 95 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
iap10@1468 96 # and place them in the install directory. 'make install' should then
iap10@1468 97 # copy them to the normal system directories
kaf24@9660 98 .PHONY: world
iap10@2842 99 world:
iap10@1558 100 $(MAKE) clean
iap10@2835 101 $(MAKE) kdelete
iap10@2845 102 $(MAKE) dist
iap10@1464 103
iap10@2842 104 # clean doesn't do a kclean
kaf24@9660 105 .PHONY: clean
keir@16275 106 clean::
iap10@3514 107 $(MAKE) -C xen clean
kaf24@3551 108 $(MAKE) -C tools clean
iap10@3514 109 $(MAKE) -C docs clean
kaf24@1446 110
kaf24@6906 111 # clean, but blow away kernel build tree plus tarballs
kaf24@9660 112 .PHONY: distclean
kaf24@10540 113 distclean:
kaf24@10540 114 $(MAKE) -C xen distclean
kaf24@10540 115 $(MAKE) -C tools distclean
kaf24@10540 116 $(MAKE) -C docs distclean
iap10@2900 117 rm -rf dist patches/tmp
iap10@3514 118 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
kaf24@10640 119 rm -rf patches/*/.makedep
iap10@1464 120
kaf24@6906 121 # Linux name for GNU distclean
kaf24@9660 122 .PHONY: mrproper
kaf24@6906 123 mrproper: distclean
kaf24@6906 124
keir@17493 125 # Prepare for source tarball
keir@17493 126 .PHONY: src-tarball
keir@17493 127 src-tarball: distclean
keir@17493 128 $(MAKE) -C xen .banner
keir@17493 129 rm -rf xen/tools/figlet
keir@17493 130 $(MAKE) -C xen distclean
keir@17493 131
kaf24@9660 132 .PHONY: help
mwilli2@3376 133 help:
mwilli2@3376 134 @echo 'Installation targets:'
kaf24@3537 135 @echo ' install - build and install everything'
cl349@3561 136 @echo ' install-xen - build and install the Xen hypervisor'
cl349@3561 137 @echo ' install-tools - build and install the control tools'
cl349@3561 138 @echo ' install-kernels - build and install guest kernels'
emellor@6792 139 @echo ' install-docs - build and install user documentation'
mwilli2@3376 140 @echo ''
mwilli2@3376 141 @echo 'Building targets:'
kaf24@3537 142 @echo ' dist - build and install everything into local dist directory'
mwilli2@3376 143 @echo ' world - clean everything, delete guest kernel build'
mwilli2@3376 144 @echo ' trees then make dist'
kaf24@3537 145 @echo ' xen - build and install Xen hypervisor'
kaf24@3537 146 @echo ' tools - build and install tools'
kaf24@3537 147 @echo ' kernels - build and install guest kernels'
mwilli2@3376 148 @echo ' kbuild - synonym for make kernels'
emellor@6792 149 @echo ' docs - build and install user documentation'
emellor@6792 150 @echo ' dev-docs - build developer-only documentation'
mwilli2@3376 151 @echo ''
mwilli2@3376 152 @echo 'Cleaning targets:'
kaf24@9653 153 @echo ' clean - clean the Xen, tools and docs (but not guest kernel trees)'
kaf24@9653 154 @echo ' distclean - clean plus delete kernel build trees and'
kaf24@9653 155 @echo ' local downloaded files'
mwilli2@3376 156 @echo ' kdelete - delete guest kernel build trees'
mwilli2@3376 157 @echo ' kclean - clean guest kernel build trees'
mwilli2@3376 158 @echo ''
mwilli2@3376 159 @echo 'Miscellaneous targets:'
vhanquez@8312 160 @echo ' prep-kernels - prepares kernel directories, does not build'
kaf24@9653 161 @echo ' uninstall - attempt to remove installed Xen tools'
kaf24@9653 162 @echo ' (use with extreme care!)'
kaf24@9654 163 @echo
keir@16275 164 @echo 'Trusted Boot (tboot) targets:'
keir@16275 165 @echo ' build-tboot - download and build the tboot module'
keir@16275 166 @echo ' install-tboot - download, build, and install the tboot module'
keir@16275 167 @echo ' clean-tboot - clean the tboot module if it exists'
keir@16275 168 @echo
kaf24@9654 169 @echo 'Environment:'
kaf24@9654 170 @echo ' XEN_PYTHON_NATIVE_INSTALL=y'
kaf24@9654 171 @echo ' - native python install or dist'
kaf24@9654 172 @echo ' install into prefix/lib/python<VERSION>'
kaf24@9654 173 @echo ' instead of <PREFIX>/lib/python'
kaf24@9654 174 @echo ' true if set to non-empty value, false otherwise'
mwilli2@3376 175
iap10@2835 176 # Use this target with extreme care!
kaf24@9660 177 .PHONY: uninstall
kaf24@3544 178 uninstall: D=$(DESTDIR)
iap10@1790 179 uninstall:
kaf24@7061 180 [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date +%s` || true
kaf24@3544 181 rm -rf $(D)/etc/init.d/xend*
kaf24@6972 182 rm -rf $(D)/etc/hotplug/xen-backend.agent
emellor@7797 183 rm -f $(D)/etc/udev/rules.d/xen-backend.rules
emellor@7797 184 rm -f $(D)/etc/udev/xen-backend.rules
emellor@7797 185 rm -f $(D)/etc/sysconfig/xendomains
kaf24@5413 186 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
kaf24@3544 187 rm -rf $(D)/boot/*xen*
bren@3868 188 rm -rf $(D)/lib/modules/*xen*
kaf24@6973 189 rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/lomount
kaf24@6308 190 rm -rf $(D)/usr/bin/cpuperf-perfcntr $(D)/usr/bin/cpuperf-xen
kaf24@6308 191 rm -rf $(D)/usr/bin/xc_shadow
kaf24@8314 192 rm -rf $(D)/usr/bin/pygrub
kaf24@8314 193 rm -rf $(D)/usr/bin/setsize $(D)/usr/bin/tbctl
kaf24@8314 194 rm -rf $(D)/usr/bin/xsls
kaf24@8314 195 rm -rf $(D)/usr/include/xenctrl.h $(D)/usr/include/xenguest.h
kaf24@6972 196 rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
kaf24@6972 197 rm -rf $(D)/usr/include/xen
keir@16841 198 rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
keir@16841 199 rm -rf $(D)$(LIBDIR)/libxenstore*
keir@16841 200 rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
keir@16841 201 rm -rf $(D)$(LIBDIR)/xen/
emellor@7797 202 rm -rf $(D)/usr/lib/xen/
kaf24@8314 203 rm -rf $(D)/usr/local/sbin/setmask $(D)/usr/local/sbin/xen*
kaf24@6972 204 rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
kaf24@6972 205 rm -rf $(D)/usr/share/doc/xen
kaf24@6972 206 rm -rf $(D)/usr/share/xen
kaf24@6308 207 rm -rf $(D)/usr/share/man/man1/xen*
kaf24@6308 208 rm -rf $(D)/usr/share/man/man8/xen*
keir@16275 209 rm -rf $(D)/boot/tboot*
mwilli2@1914 210
kaf24@2978 211 # Legacy targets for compatibility
kaf24@9660 212 .PHONY: linux26
iap10@3514 213 linux26:
kaf24@5697 214 $(MAKE) 'KERNELS=linux-2.6*' kernels
keir@16275 215
keir@16275 216
keir@16275 217 #
keir@16275 218 # tboot targets
keir@16275 219 #
keir@16275 220
keir@16512 221 TBOOT_TARFILE = tboot-20071128.tar.gz
keir@16275 222 TBOOT_BASE_URL = http://downloads.sourceforge.net/tboot
keir@16275 223
keir@16275 224 .PHONY: build-tboot
keir@16275 225 build-tboot: download_tboot
keir@16275 226 $(MAKE) -C tboot build
keir@16275 227
keir@16275 228 .PHONY: install-tboot
keir@16275 229 install-tboot: download_tboot
keir@16275 230 $(MAKE) -C tboot install
keir@16275 231
keir@16512 232 .PHONY: dist-tboot
keir@16512 233 dist-tboot: download_tboot
keir@16512 234 $(MAKE) DESTDIR=$(DISTDIR)/install -C tboot dist
keir@16512 235
keir@16275 236 .PHONY: clean-tboot
keir@16275 237 clean-tboot:
keir@16275 238 [ ! -d tboot ] || $(MAKE) -C tboot clean
keir@16275 239
keir@16275 240 .PHONY: distclean-tboot
keir@16275 241 distclean-tboot:
keir@16275 242 [ ! -d tboot ] || $(MAKE) -C tboot distclean
keir@16275 243
keir@16275 244 .PHONY: download_tboot
keir@16275 245 download_tboot: tboot/Makefile
keir@16275 246
keir@16275 247 tboot/Makefile: tboot/$(TBOOT_TARFILE)
keir@16275 248 [ -e tboot/Makefile ] || tar -xzf tboot/$(TBOOT_TARFILE) -C tboot/ --strip-components 1
keir@16275 249
keir@16275 250 tboot/$(TBOOT_TARFILE):
keir@16275 251 mkdir -p tboot
keir@16275 252 wget -O tboot/$(TBOOT_TARFILE) $(TBOOT_BASE_URL)/$(TBOOT_TARFILE)