direct-io.hg

view buildconfigs/Rules.mk @ 5517:10e9028c8e3d

bitkeeper revision 1.1718.1.10 (42b7b19aqOS_1M8I4pIOFjiTPYWV-g)

Merge bk://xenbits.xensource.com/xen-unstable.bk
into spot.cl.cam.ac.uk:C:/Documents and Settings/iap10/xen-unstable.bk
author iap10@spot.cl.cam.ac.uk
date Tue Jun 21 06:20:10 2005 +0000 (2005-06-21)
parents f915b63407b4 f2c023b9a070
children 649cd37aa1ab
line source
2 include Config.mk
4 # We expect these two to already be set if people
5 # are using the top-level Makefile
6 DISTDIR ?= $(CURDIR)/dist
7 DESTDIR ?= $(DISTDIR)/install
9 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
10 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
12 .PHONY: mkpatches mrproper
14 # Setup pristine search path
15 PRISTINE_SRC_PATH ?= .:..
16 vpath pristine-% $(PRISTINE_SRC_PATH)
18 # Expand Linux series to Linux version
19 LINUX_SERIES ?= 2.6
20 LINUX_VER ?= $(patsubst linux-%-xen-sparse,%,$(wildcard linux-$(LINUX_SERIES)*-xen-sparse))
22 # Setup Linux search path
23 LINUX_SRC_PATH ?= .:..
24 vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
26 # download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
27 linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
28 linux-%.tar.bz2:
29 @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
30 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
32 # Expand NetBSD release to NetBSD version
33 NETBSD_RELEASE ?= 2.0
34 NETBSD_VER ?= $(patsubst netbsd-%-xen-sparse,%,$(wildcard netbsd-$(NETBSD_RELEASE)*-xen-sparse))
35 NETBSD_CVSSNAP ?= 20050309
37 # Setup NetBSD search path
38 NETBSD_SRC_PATH ?= .:..
39 vpath netbsd-%.tar.bz2 $(NETBSD_SRC_PATH)
41 # download a pristine NetBSD tarball if there isn't one in NETBSD_SRC_PATH
42 netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
43 @echo "Cannot find $@ in path $(NETBSD_SRC_PATH)"
44 wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/$@ -O./$@
46 netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
47 ln -fs $< $@
49 ifeq ($(OS),linux)
50 OS_VER = $(LINUX_VER)
51 else
52 OS_VER = $(NETBSD_VER)
53 endif
55 $(patsubst %,pristine-%/.valid-pristine,$(ALLSPARSETREES)) : pristine-%/.valid-pristine: %.tar.bz2
56 rm -rf tmp-pristine-$* $(@D)
57 mkdir -p tmp-pristine-$*
58 touch tmp-pristine-$*/.bk_skip
59 tar -C tmp-pristine-$* -jxf $<
60 -@rm tmp-pristine-$*/pax_global_header
61 mv tmp-pristine-$*/* $(@D)
62 @rm -rf tmp-pristine-$*
63 touch $@ # update timestamp to avoid rebuild
65 PATCHDIRS := $(wildcard patches/*-*)
67 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
69 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
70 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
72 clean::
73 rm -f patches/*/.makedep
75 ref-%/.valid-ref: pristine-%/.valid-pristine
76 rm -rf $(@D)
77 cp -al $(<D) $(@D)
78 ([ -d patches/$* ] && \
79 for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
80 touch $@ # update timestamp to avoid rebuild
82 %-build:
83 $(MAKE) -f buildconfigs/mk.$* build
85 %-delete:
86 $(MAKE) -f buildconfigs/mk.$* delete
88 %-clean:
89 $(MAKE) -f buildconfigs/mk.$* clean
91 %-config:
92 $(MAKE) -f buildconfigs/mk.$* config
94 %-xen.patch: ref-%/.valid-ref
95 rm -rf tmp-$@
96 cp -al $(<D) tmp-$@
97 ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
98 diff -Nurp $(<D) tmp-$@ > $@ || true
99 rm -rf tmp-$@
101 %-mrproper: %-mrproper-extra
102 rm -rf pristine-$* ref-$* $*.tar.bz2
103 rm -rf $*-xen.patch
105 netbsd-%-mrproper-extra:
106 rm -rf netbsd-$*-tools netbsd-$*-tools.tar.bz2
107 rm -f netbsd-$*-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
109 %-mrproper-extra:
110 @: # do nothing
112 # never delete any intermediate files.
113 .SECONDARY: