ia64/xen-unstable

annotate Makefile @ 2686:c6c0f98bf7d3

bitkeeper revision 1.1159.120.2 (4177c0c45rkuaBFhtYj9E1LEJ8ti4w)

Unify 2.4 and 2.6 balloon drivers, xm can now control balloon in 2.4 domains.
More random docs work.
author mwilli2@equilibrium.research
date Thu Oct 21 13:59:32 2004 +0000 (2004-10-21)
parents 924a0fb0c200
children 2c4a115fcca1
rev   line source
kaf24@1446 1 #
kaf24@424 2 # Grand Unified Makefile for Xen.
kaf24@424 3 #
kaf24@424 4
iap10@1464 5 INSTALL_DIR ?= $(shell pwd)/install
iap10@1464 6
kaf24@1565 7 SOURCEFORGE_MIRROR := http://heanet.dl.sourceforge.net/sourceforge
iap10@1558 8 #http://voxel.dl.sourceforge.net/sourceforge/
iap10@1558 9 #http://easynews.dl.sourceforge.net/sourceforge
iap10@1558 10
mwilli2@1914 11 .PHONY: docs delete-symlinks clean
mwilli2@1914 12
iap10@1468 13 # a not partcularly useful but safe default target
kaf24@1446 14 all: make-symlinks
iap10@1558 15 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
iap10@1558 16 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
kaf24@424 17
iap10@1468 18 # install everything into the standard system directories
iap10@1558 19 install: dist
iap10@428 20 $(MAKE) -C xen install
iap10@771 21 $(MAKE) -C tools install
iap10@1464 22 $(shell cp -a install/boot/*$(LINUX_VER)* /boot/)
iap10@1527 23 $(shell cp -a install/lib/modules/* /lib/modules/)
iap10@428 24
iap10@1468 25 # install xen and tools into the install directory
kaf24@972 26 dist: all
iap10@1558 27 $(MAKE) linux-xenU
iap10@1558 28 $(MAKE) linux-xen0
kaf24@972 29
iap10@2366 30 LINUX_RELEASE ?= 2.6
cl349@1796 31 LINUX_VER ?= $(shell ( /bin/ls -ld linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
cl349@1796 32 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
kaf24@2028 33 LINUX26_VER ?= $(shell ( /bin/ls -ld linux-2.6.*-xen-sparse ) 2>/dev/null | \
cl349@1986 34 sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
iap10@1464 35 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
iap10@1467 36 LINUX_SRC_PATH ?= .:..
kaf24@1565 37 LINUX_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
kaf24@1565 38 $(wildcard $(dir)/linux-$(LINUX_VER).tar.*z*)))
iap10@1453 39
iap10@1468 40 # search for a pristine kernel tar ball, or try downloading one
iap10@1467 41 pristine-linux-src:
kaf24@1565 42 ifeq ($(LINUX_SRC),)
kaf24@1565 43 @echo "Cannot find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
cl349@1796 44 @wget http://www.kernel.org/pub/linux/kernel/v$(LINUX_RELEASE)/linux-$(LINUX_VER).tar.bz2 -O./linux-$(LINUX_VER).tar.bz2
kaf24@1565 45 LINUX_SRC := ./linux-$(LINUX_VER).tar.bz2
iap10@1467 46 endif
iap10@1453 47
iap10@2330 48 patches/ebtables.diff:
iap10@1558 49 mkdir -p patches
iap10@2330 50 #wget $(SOURCEFORGE_MIRROR)/ebtables/ebtables-brnf-5_vs_2.4.25.diff.gz \
kaf24@1565 51 -O- | gunzip -c > $@
iap10@2330 52 wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@
iap10@1558 53
kaf24@1565 54 LINUX_TREES := linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
iap10@1527 55
iap10@1468 56 # make a linux-xen build tree from a pristine kernel plus sparse tree
cl349@1796 57 ifeq ($(LINUX_RELEASE),2.4)
iap10@2330 58 mk-linux-trees: patches/ebtables.diff pristine-linux-src
iap10@1558 59 $(RM) -rf $(LINUX_TREES)
kaf24@1565 60 echo $(LINUX_SRC) | grep -q bz2 && \
kaf24@1565 61 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
iap10@1558 62 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
kaf24@1565 63 ( cd linux-$(LINUX_VER)-xen-sparse ; \
kaf24@1565 64 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
iap10@1558 65 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
kaf24@1565 66 ( cd linux-$(LINUX_VER)-xen0 ; \
iap10@2330 67 patch -p1 -F3 < ../patches/ebtables.diff )
cl349@1796 68 else
cl349@1796 69 mk-linux-trees: pristine-linux-src
cl349@1796 70 $(RM) -rf $(LINUX_TREES)
cl349@1796 71 echo $(LINUX_SRC) | grep -q bz2 && \
cl349@1796 72 tar -jxf $(LINUX_SRC) || tar -zxf $(LINUX_SRC)
cl349@1922 73 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen0
cl349@1796 74 ( cd linux-$(LINUX_VER)-xen-sparse ; \
cl349@1922 75 ./mkbuildtree ../linux-$(LINUX_VER)-xen0 )
cl349@1922 76 cp -al linux-$(LINUX_VER)-xen0 linux-$(LINUX_VER)-xenU
cl349@1796 77 endif
iap10@1459 78
iap10@1558 79 # configure the specified linux tree
kaf24@1565 80 CDIR = $(subst config-,linux-$(LINUX_VER)-,$@)
cl349@1796 81 ifeq ($(LINUX_RELEASE),2.4)
iap10@1558 82 config-xen%:
kaf24@1565 83 $(MAKE) -C $(CDIR) ARCH=xen mrproper
kaf24@1565 84 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
kaf24@1565 85 $(CDIR)/.config || \
kaf24@1565 86 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_config
kaf24@1565 87 $(MAKE) -C $(CDIR) ARCH=xen oldconfig
kaf24@1565 88 $(MAKE) -C $(CDIR) ARCH=xen dep
cl349@1796 89 else
cl349@1796 90 config-xen%:
cl349@1796 91 $(MAKE) -C $(CDIR) ARCH=xen mrproper
cl349@1800 92 @[ -e $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) ] \
cl349@1800 93 && cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config-,,$@) \
cl349@1800 94 $(CDIR)/.config || \
iap10@1799 95 $(MAKE) -C $(CDIR) ARCH=xen $(subst config-,,$@)_defconfig
cl349@1796 96 endif
iap10@1464 97
iap10@1558 98 # build the specified linux tree
kaf24@1565 99 BDIR = $(subst linux-,linux-$(LINUX_VER)-,$@)
iap10@1558 100 linux-xen%:
kaf24@1565 101 $(MAKE) -C $(BDIR) ARCH=xen modules
kaf24@1565 102 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) \
kaf24@1565 103 modules_install
kaf24@1565 104 $(MAKE) -C $(BDIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
iap10@1467 105
cl349@2443 106
cl349@2443 107 NETBSD_RELEASE ?= 2.0
cl349@2443 108 NETBSD_VER ?= $(shell ( /bin/ls -ld netbsd-$(NETBSD_RELEASE)*-xen-sparse ) 2>/dev/null | \
cl349@2443 109 sed -e 's!^.*netbsd-\(.\+\)-xen-sparse!\1!' )
cl349@2443 110 NETBSD_CVSSNAP ?= 20040906
cl349@2443 111 NETBSD_SRC_PATH ?= .:..
cl349@2443 112 NETBSD_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
cl349@2443 113 $(wildcard $(dir)/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.*z*)))
cl349@2443 114 NETBSD_TOOLS_SRC ?= $(firstword $(foreach dir,$(subst :, ,$(NETBSD_SRC_PATH)),\
cl349@2443 115 $(wildcard $(dir)/netbsd-$(NETBSD_VER)-tools.tar.*z*)))
cl349@2443 116
cl349@2443 117 NETBSD_TREES := netbsd-$(NETBSD_VER)-xenU
cl349@2443 118
cl349@2443 119 pristine-netbsd-src:
cl349@2443 120 ifeq ($(NETBSD_SRC),)
cl349@2443 121 @echo "Cannot find netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.gz in path $(NETBSD_SRC_PATH)"
cl349@2443 122 @wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2 -O./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
cl349@2443 123 NETBSD_SRC := ./netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
cl349@2443 124 endif
cl349@2443 125
cl349@2443 126 pristine-netbsd-tools-src:
cl349@2443 127 ifeq ($(NETBSD_TOOLS_SRC),)
cl349@2443 128 @echo "Cannot find netbsd-$(NETBSD_VER)-tools.tar.gz in path $(NETBSD_SRC_PATH)"
cl349@2443 129 @wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/netbsd-$(NETBSD_VER)-tools.tar.bz2 -O./netbsd-$(NETBSD_VER)-tools.tar.bz2
cl349@2443 130 NETBSD_TOOLS_SRC := ./netbsd-$(NETBSD_VER)-tools.tar.bz2
cl349@2443 131 endif
cl349@2443 132
cl349@2443 133 netbsd-tools: pristine-netbsd-tools-src
cl349@2443 134 @[ -d netbsd-$(NETBSD_RELEASE)-tools ] || { \
cl349@2443 135 echo extract $(NETBSD_TOOLS_SRC); \
cl349@2443 136 tar -jxf $(NETBSD_TOOLS_SRC); }
cl349@2443 137
cl349@2443 138 mk-netbsd-trees: netbsd-tools pristine-netbsd-src
cl349@2443 139 $(RM) -rf $(NETBSD_TREES)
cl349@2443 140 echo $(NETBSD_SRC) | grep -q bz2 && \
cl349@2443 141 tar -jxf $(NETBSD_SRC) || tar -zxf $(NETBSD_SRC)
cl349@2443 142 mv netbsd-$(NETBSD_VER)-xen-kernel-$(NETBSD_CVSSNAP) \
cl349@2443 143 netbsd-$(NETBSD_VER)-xenU
cl349@2443 144 ( cd netbsd-$(NETBSD_VER)-xen-sparse ; \
cl349@2443 145 ./mkbuildtree ../netbsd-$(NETBSD_VER)-xenU )
cl349@2443 146
cl349@2443 147 # build the specified netbsd tree
cl349@2447 148 NBDIR = $(subst netbsd-,netbsd-$(NETBSD_VER)-,$@)
cl349@2443 149 netbsd-xen%:
cl349@2447 150 $(MAKE) -C $(NBDIR) config
cl349@2447 151 $(MAKE) -C $(NBDIR) netbsd
cl349@2447 152 $(MAKE) -C $(NBDIR) INSTALL_PATH=$(INSTALL_DIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-$(subst netbsd-,,$@) install
cl349@2443 153
iap10@1468 154 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
iap10@1468 155 # and place them in the install directory. 'make install' should then
iap10@1468 156 # copy them to the normal system directories
iap10@1558 157 world:
iap10@1558 158 $(MAKE) clean
iap10@1558 159 $(MAKE) all
iap10@1558 160 $(MAKE) mk-linux-trees
iap10@1558 161 $(MAKE) config-xenU
iap10@1558 162 $(MAKE) linux-xenU
iap10@1558 163 $(MAKE) config-xen0
iap10@1558 164 $(MAKE) linux-xen0
mwilli2@1914 165 $(MAKE) docs
iap10@1464 166
cl349@1796 167 linux26:
cl349@1796 168 $(MAKE) LINUX_RELEASE=2.6 mk-linux-trees
cl349@1796 169 $(MAKE) LINUX_RELEASE=2.6 config-xenU
cl349@1796 170 $(MAKE) LINUX_RELEASE=2.6 linux-xenU
cl349@2011 171 $(MAKE) LINUX_RELEASE=2.6 config-xen0
cl349@2011 172 $(MAKE) LINUX_RELEASE=2.6 linux-xen0
cl349@1796 173
iap10@2366 174 linux24:
iap10@2366 175 $(MAKE) LINUX_RELEASE=2.4 mk-linux-trees
iap10@2366 176 $(MAKE) LINUX_RELEASE=2.4 config-xenU
iap10@2366 177 $(MAKE) LINUX_RELEASE=2.4 linux-xenU
iap10@2366 178 $(MAKE) LINUX_RELEASE=2.4 config-xen0
iap10@2366 179 $(MAKE) LINUX_RELEASE=2.4 linux-xen0
kaf24@1446 180
cl349@2443 181 netbsd:
cl349@2443 182 $(MAKE) mk-netbsd-trees
cl349@2443 183 $(MAKE) netbsd-xenU
cl349@2443 184
kaf24@1446 185 clean: delete-symlinks
kaf24@424 186 $(MAKE) -C xen clean
iap10@771 187 $(MAKE) -C tools clean
mwilli2@1914 188 $(MAKE) -C docs clean
kaf24@1446 189
iap10@1468 190 # clean, but blow away linux build tree plus src tar ball
iap10@1464 191 mrproper: clean
iap10@1558 192 rm -rf install/* patches $(LINUX_TREES) linux-$(LINUX_VER).tar.*
iap10@1464 193
kaf24@1448 194 make-symlinks: delete-symlinks
kaf24@2028 195 ln -sf linux-$(LINUX26_VER)-xen-sparse linux-xen-sparse
kaf24@1446 196
kaf24@1446 197 delete-symlinks:
kaf24@1446 198 $(RM) linux-xen-sparse
iap10@1464 199
iap10@1558 200 # handy target to install twisted (use rpm or apt-get in preference)
iap10@1558 201 install-twisted:
iap10@1558 202 wget http://www.twistedmatrix.com/products/get-current.epy
iap10@1558 203 tar -zxf Twisted-*.tar.gz
kaf24@1565 204 ( cd Twisted-* ; python setup.py install )
iap10@1464 205
mjw@1843 206 install-logging: LOGGING=logging-0.4.9.2
mjw@1843 207 install-logging:
mjw@1843 208 [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz
iap10@2040 209 tar -zxf $(LOGGING).tar.gz
mjw@1843 210 ( cd $(LOGGING) && python setup.py install )
mjw@1843 211
iap10@1558 212 # handy target to upgrade iptables (use rpm or apt-get in preference)
iap10@1558 213 install-iptables:
iap10@1558 214 wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
iap10@1558 215 tar -jxf iptables-*.tar.bz2
kaf24@1565 216 ( cd iptables-* ; \
kaf24@1565 217 make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install)
iap10@1558 218
iap10@1790 219 uninstall:
iap10@1790 220 cp -a /etc/xen /etc/xen.old && rm -rf /etc/xen
iap10@1790 221 rm -rf "/usr/lib/python2.2/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.2/site-packages/Xc*"
mwilli2@1914 222
mwilli2@1914 223 docs:
mwilli2@1914 224 $(MAKE) -C docs all || true