ia64/xen-unstable

view Makefile @ 1527:a815a43920c0

bitkeeper revision 1.994 (40d6ed9ePUmxTwjKFv1vprN2-xFpmQ)

Install mkernel odules with 'make install'
author iap10@labyrinth.cl.cam.ac.uk
date Mon Jun 21 14:15:58 2004 +0000 (2004-06-21)
parents 9e12dfe14287
children 8d6a0fcaa924 6802d4f0ce7f
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/)
17 $(shell cp -a install/lib/modules/* /lib/modules/)
19 # install xen and tools into the install directory
20 dist: all
21 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
22 $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
24 LINUX_VER ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
25 LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot
26 LINUX_SRC_PATH ?= .:..
27 LINUX_SRC_X ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),$(wildcard $(dir)/linux-$(LINUX_VER).tar.gz)))
29 # search for a pristine kernel tar ball, or try downloading one
30 pristine-linux-src:
31 ifneq ($(LINUX_SRC),)
32 @[ -r "$(LINUX_SRC)" ] || (echo "Can not find linux src at $(LINUX_SRC)" && false)
33 LINUX_SRC_X = $(LINUX_SRC)
34 else
35 ifeq ($(LINUX_SRC_X),)
36 @echo "Can not find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)"
37 @wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.gz -O./linux-$(LINUX_VER).tar.gz
38 LINUX_SRC_X = ./linux-$(LINUX_VER).tar.gz
39 endif
40 endif
42 patch-xen0-bridge-nf:
43 (cd linux-$(LINUX_VER)-xen && patch -p1 -F3 < ../patches/ebtables-brnf-5_vs_2.4.25.diff)
45 # make a linux-xen build tree from a pristine kernel plus sparse tree
46 linux-$(LINUX_VER)-xen: pristine-linux-src
47 $(RM) -rf linux-$(LINUX_VER)-xen
48 tar -x -z -f $(LINUX_SRC_X)
49 mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen
50 ( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../linux-$(LINUX_VER)-xen )
52 # config linux-xen from a specified defaults file
53 linux_%_config:
54 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen mrproper
55 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_,,$(@))
56 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen oldconfig
57 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen dep
59 # build and install to a specified install name
60 linux_%:
61 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen modules
62 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
63 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_PATH=$(INSTALL_DIR) install
65 # shorthand with no siffix
66 linux:
67 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen modules
68 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install
69 $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install
71 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
72 # and place them in the install directory. 'make install' should then
73 # copy them to the normal system directories
74 world: dist
75 $(MAKE) linux-$(LINUX_VER)-xen
76 $(MAKE) linux_xenU_config
77 $(MAKE) linux_xenU
78 $(MAKE) linux_xen0_config
79 $(MAKE) linux_xen0
82 clean: delete-symlinks
83 $(MAKE) -C xen clean
84 $(MAKE) -C tools clean
86 # clean, but blow away linux build tree plus src tar ball
87 mrproper: clean
88 rm -rf install linux-$(LINUX_VER)-xen linux-$(LINUX_VER).tar.gz
91 make-symlinks: delete-symlinks
92 ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
94 delete-symlinks:
95 $(RM) linux-xen-sparse