ia64/xen-unstable

view buildconfigs/Rules.mk @ 5755:be1153585cb0

Fix hgignore regexps some more.
author kaf24@firebug.cl.cam.ac.uk
date Tue Jul 12 16:19:59 2005 +0000 (2005-07-12)
parents b5e3b99075c6
children 79d52bd557cf
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
21 # Setup Linux search path
22 LINUX_SRC_PATH ?= .:..
23 vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
25 # download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
26 linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
27 linux-%.tar.bz2:
28 @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
29 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
31 # Expand NetBSD release to NetBSD version
32 NETBSD_RELEASE ?= 2.0
33 NETBSD_VER ?= $(patsubst netbsd-%-xen-sparse,%,$(wildcard netbsd-$(NETBSD_RELEASE)*-xen-sparse))
34 NETBSD_CVSSNAP ?= 20050309
36 # Setup NetBSD search path
37 NETBSD_SRC_PATH ?= .:..
38 vpath netbsd-%.tar.bz2 $(NETBSD_SRC_PATH)
40 # download a pristine NetBSD tarball if there isn't one in NETBSD_SRC_PATH
41 netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
42 @echo "Cannot find $@ in path $(NETBSD_SRC_PATH)"
43 wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/$@ -O./$@
45 netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
46 ln -fs $< $@
48 ifeq ($(OS),linux)
49 OS_VER = $(LINUX_VER)
50 else
51 OS_VER = $(NETBSD_VER)
52 endif
54 pristine-%/.valid-pristine: %.tar.bz2
55 rm -rf tmp-pristine-$* $(@D)
56 mkdir -p tmp-pristine-$*
57 tar -C tmp-pristine-$* -jxf $<
58 -@rm tmp-pristine-$*/pax_global_header
59 mv tmp-pristine-$*/* $(@D)
60 @rm -rf tmp-pristine-$*
61 touch $(@D)/.hgskip
62 touch $@ # update timestamp to avoid rebuild
64 PATCHDIRS := $(wildcard patches/*-*)
66 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
68 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
69 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
71 clean::
72 rm -f patches/*/.makedep
74 ref-%/.valid-ref: pristine-%/.valid-pristine
75 rm -rf $(@D)
76 cp -al $(<D) $(@D)
77 ([ -d patches/$* ] && \
78 for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
79 touch $@ # update timestamp to avoid rebuild
81 %-build:
82 $(MAKE) -f buildconfigs/mk.$* build
84 %-delete:
85 $(MAKE) -f buildconfigs/mk.$* delete
87 %-clean:
88 $(MAKE) -f buildconfigs/mk.$* clean
90 %-config:
91 $(MAKE) -f buildconfigs/mk.$* config
93 %-xen.patch: ref-%/.valid-ref
94 rm -rf tmp-$@
95 cp -al $(<D) tmp-$@
96 ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
97 diff -Nurp $(<D) tmp-$@ > $@ || true
98 rm -rf tmp-$@
100 %-mrproper: %-mrproper-extra
101 rm -rf pristine-$* ref-$* $*.tar.bz2
102 rm -rf $*-xen.patch
104 netbsd-%-mrproper-extra:
105 rm -rf netbsd-$*-tools netbsd-$*-tools.tar.bz2
106 rm -f netbsd-$*-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
108 %-mrproper-extra:
109 @: # do nothing
111 # never delete any intermediate files.
112 .SECONDARY: