ia64/xen-unstable

view Makefile @ 1518:9b9720f48ab1

bitkeeper revision 1.993 (40d6a9ddBgr-KXWbCA_-rEDpeCQHQw)

Fix pdb.
author kaf24@scramble.cl.cam.ac.uk
date Mon Jun 21 09:26:53 2004 +0000 (2004-06-21)
parents 9e12dfe14287
children a815a43920c0
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_,,$(@))) linux-$(LINUX_VER)-xen/.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 modules
58 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
59 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_PATH=$(INSTALL_DIR) install
61 # shorthand with no siffix
62 linux:
63 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen modules
64 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
65 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
67 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
68 # and place them in the install directory. 'make install' should then
69 # copy them to the normal system directories
70 world: dist
71 $(MAKE) linux-$(LINUX_VER)-xen
72 $(MAKE) linux_xenU_config
73 $(MAKE) linux_xenU
74 $(MAKE) linux_xen0_config
75 $(MAKE) linux_xen0
78 clean: delete-symlinks
79 $(MAKE) -C xen clean
80 $(MAKE) -C tools clean
82 # clean, but blow away linux build tree plus src tar ball
83 mrproper: clean
84 rm -rf install linux-$(LINUX_VER)-xen linux-$(LINUX_VER).tar.gz
87 make-symlinks: delete-symlinks
88 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
90 delete-symlinks:
91 $(RM) linux-xen-sparse