ia64/xen-unstable

view buildconfigs/Rules.mk @ 2860:61d139354129

bitkeeper revision 1.1159.157.1 (418934b0-qzq3Mn8ZcEAFEUYycHb2Q)

Device section fixes.
author akw27@labyrinth.cl.cam.ac.uk
date Wed Nov 03 19:42:40 2004 +0000 (2004-11-03)
parents 42df95ee8ac3
children 9e8025840eed 23cadd2f9146 fb24f726e556
line source
2 # We expect these two to already be set if people
3 # are using the top-level Makefile
4 DIST_DIR ?= $(shell pwd)/dist
5 INSTALL_DIR ?= $(DIST_DIR)/install
8 # Figure out which Linux version
9 LINUX_26VER ?= $(shell ( /bin/ls -ld linux-2.6.*-xen-sparse ) \
10 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
12 LINUX_24VER ?= $(shell ( /bin/ls -ld linux-2.4.*-xen-sparse ) \
13 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
15 LINUX_SRC_PATH ?= .:..
17 LINUX_26SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
18 $(wildcard $(dir)/linux-$(LINUX_26VER).tar.*z*)))
20 LINUX_24SRC ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),\
21 $(wildcard $(dir)/linux-$(LINUX_24VER).tar.*z*)))
23 .PHONY: mkpatches linux-$(LINUX_24VER)-xen.patch linux-$(LINUX_26VER)-xen.patch mrproper
25 # search for a pristine kernel tar ball, or try downloading one
26 linux-$(LINUX_26VER).tar.bz2:
27 ifeq ($(LINUX_26SRC),)
28 echo "Cannot find linux-$(LINUX_26VER).tar.bz2 in path $(LINUX_SRC_PATH)"
29 wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-$(LINUX_26VER).tar.bz2 -O./linux-$(LINUX_26VER).tar.bz2
30 LINUX_26SRC := ./linux-$(LINUX_26VER).tar.bz2
31 endif
33 pristine-linux-$(LINUX_26VER): $(LINUX_26SRC)
34 rm -rf tmp-linux-$(LINUX_26VER) $@ && \
35 mkdir -p tmp-linux-$(LINUX_26VER) && \
36 tar -C tmp-linux-$(LINUX_26VER) -jxf $(LINUX_26SRC) && \
37 mv tmp-linux-$(LINUX_26VER)/* $@
38 touch $@ # update timestamp to avoid rebuild
39 @rm -rf tmp-linux-$(LINUX_26VER)
42 # search for a pristine kernel tar ball, or try downloading one
43 linux-$(LINUX_24VER).tar.bz2:
44 ifeq ($(LINUX_24SRC),)
45 echo "Cannot find linux-$(LINUX_24VER).tar.bz2 in path $(LINUX_SRC_PATH)"
46 wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_24VER).tar.bz2 -O./linux-$(LINUX_24VER).tar.bz2
47 LINUX_24SRC := ./linux-$(LINUX_24VER).tar.bz2
48 endif
50 pristine-linux-$(LINUX_24VER): $(LINUX_24SRC)
51 rm -rf tmp-linux-$(LINUX_24VER) $@ && \
52 mkdir -p tmp-linux-$(LINUX_24VER) && \
53 tar -C tmp-linux-$(LINUX_24VER) -jxf $(LINUX_24SRC) && \
54 mv tmp-linux-$(LINUX_24VER)/* $@ && \
55 touch $@ # update timestamp to avoid rebuild
56 @rm -rf tmp-linux-$(LINUX_24VER)
58 linux-$(LINUX_24VER)-xen.patch: pristine-linux-$(LINUX_24VER)
59 rm -rf tmp-$@
60 cp -al pristine-linux-$(LINUX_24VER) tmp-$@
61 ( cd linux-$(LINUX_24VER)-xen-sparse ; \
62 ./mkbuildtree ../tmp-$@ )
63 diff -Nurp pristine-linux-$(LINUX_24VER) tmp-$@ > $@ || true
64 rm -rf tmp-$@
66 linux-$(LINUX_26VER)-xen.patch: pristine-linux-$(LINUX_26VER)
67 rm -rf tmp-$@
68 cp -al pristine-linux-$(LINUX_26VER) tmp-$@
69 ( cd linux-$(LINUX_26VER)-xen-sparse ; \
70 ./mkbuildtree ../tmp-$@ )
71 diff -Nurp pristine-linux-$(LINUX_26VER) tmp-$@ > $@ || true
72 rm -rf tmp-$@
74 mkpatches: linux-$(LINUX_24VER)-xen.patch linux-$(LINUX_26VER)-xen.patch
76 mrproper:
77 rm -rf pristine-linux-$(LINUX_24VER) linux-$(LINUX_24VER).tar.bz2
78 rm -rf pristine-linux-$(LINUX_26VER) linux-$(LINUX_26VER).tar.bz2
79 rm -rf linux-$(LINUX_24VER)-xen.patch linux-$(LINUX_26VER)-xen.patch
80 rm -rf pristine-netbsd-2.0 netbsd-2.0-tools