ia64/xen-unstable

view Makefile @ 1486:55825bcb964e

bitkeeper revision 1.970 (40d07ec6txkdBLgbvygm7O1rxKCY1A)

Cleanups allowed by new ngio world.
author kaf24@scramble.cl.cam.ac.uk
date Wed Jun 16 17:09:26 2004 +0000 (2004-06-16)
parents a53cc9700ac8
children c2247f632d3f
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 INSTALL_DIR ?= $(shell pwd)/install
7 # a not partcularly useful but safe default target
8 all: make-symlinks
9 $(MAKE) -C xen
10 $(MAKE) -C tools
12 # install everything into the standard system directories
13 install: all
14 $(MAKE) -C xen install
15 $(MAKE) -C tools install
16 $(shell cp -a install/boot/*$(LINUX_VER)* /boot/)
18 # install xen and tools into the install directory
19 dist: all
20 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
21 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
23 LINUX_VER ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
24 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
25 LINUX_SRC_PATH ?= .:..
26 LINUX_SRC_X ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),$(wildcard $(dir)/linux-$(LINUX_VER).tar.gz)))
28 # search for a pristine kernel tar ball, or try downloading one
29 pristine-linux-src:
30 ifneq ($(LINUX_SRC),)
31 @[ -r "$(LINUX_SRC)" ] || (echo "Can not find linux src at $(LINUX_SRC)" && false)
32 LINUX_SRC_X = $(LINUX_SRC)
33 else
34 ifeq ($(LINUX_SRC_X),)
35 @echo "Can not find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
36 @wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.gz -O./linux-$(LINUX_VER).tar.gz
37 LINUX_SRC_X = ./linux-$(LINUX_VER).tar.gz
38 endif
39 endif
41 # make a linux-xen build tree from a pristine kernel plus sparse tree
42 linux-$(LINUX_VER)-xen: pristine-linux-src
43 $(RM) -rf linux-$(LINUX_VER)-xen
44 tar -x -z -f $(LINUX_SRC_X)
45 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen
46 ( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../linux-$(LINUX_VER)-xen )
48 # config linux-xen from a specified defaults file
49 linux_%_config:
50 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen mrproper
51 cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst _config,,$(subst linux_,,$(@))) .config || $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen $(subst linux_,,$(@))
52 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen oldconfig
53 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen dep
55 # build and install to a specified install name
56 linux_%:
57 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_PATH=$(INSTALL_DIR) install
59 # shorthand with no siffix
60 linux:
61 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
63 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
64 # and place them in the install directory. 'make install' should then
65 # copy them to the normal system directories
66 world: dist
67 $(MAKE) linux-$(LINUX_VER)-xen
68 $(MAKE) linux_xenU_config
69 $(MAKE) linux_xenU
70 $(MAKE) linux_xen0_config
71 $(MAKE) linux_xen0
74 clean: delete-symlinks
75 $(MAKE) -C xen clean
76 $(MAKE) -C tools clean
78 # clean, but blow away linux build tree plus src tar ball
79 mrproper: clean
80 rm -rf install linux-$(LINUX_VER)-xen linux-$(LINUX_VER).tar.gz
83 make-symlinks: delete-symlinks
84 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
86 delete-symlinks:
87 $(RM) linux-xen-sparse