ia64/xen-unstable

view buildconfigs/Rules.mk @ 7781:41c8a2ea07c0

Fix application of OS patches to deal better with failure.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Nov 11 11:16:46 2005 +0100 (2005-11-11)
parents 848f21d57278
children 4480e22f2ef2
line source
2 include Config.mk
4 export DESTDIR
6 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
7 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
9 .PHONY: mkpatches mrproper
11 # Setup pristine search path
12 PRISTINE_SRC_PATH ?= .:..
13 vpath pristine-% $(PRISTINE_SRC_PATH)
15 # By default, build Linux with ARCH=xen (overridden by some non arch's)
16 ifneq ($(XEN_TARGET_ARCH),ia64)
17 LINUX_ARCH ?= xen
18 else
19 LINUX_ARCH ?= ia64
20 endif
22 # Expand Linux series to Linux version
23 LINUX_SERIES ?= 2.6
25 # Setup Linux search path
26 LINUX_SRC_PATH ?= .:..
27 vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
29 # download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
30 linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
31 linux-%.tar.bz2:
32 @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
33 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
35 # Expand NetBSD release to NetBSD version
36 NETBSD_RELEASE ?= 2.0
37 NETBSD_VER ?= $(patsubst netbsd-%-xen-sparse,%,$(wildcard netbsd-$(NETBSD_RELEASE)*-xen-sparse))
38 NETBSD_CVSSNAP ?= 20050309
40 # Setup NetBSD search path
41 NETBSD_SRC_PATH ?= .:..
42 vpath netbsd-%.tar.bz2 $(NETBSD_SRC_PATH)
44 # download a pristine NetBSD tarball if there isn't one in NETBSD_SRC_PATH
45 netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
46 @echo "Cannot find $@ in path $(NETBSD_SRC_PATH)"
47 wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/$@ -O./$@
49 netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
50 ln -fs $< $@
52 ifeq ($(OS),linux)
53 OS_VER = $(LINUX_VER)
54 else
55 OS_VER = $(NETBSD_VER)
56 endif
58 pristine-%: pristine-%/.valid-pristine
59 @true
61 pristine-%/.valid-pristine: %.tar.bz2
62 rm -rf tmp-pristine-$* $(@D)
63 mkdir -p tmp-pristine-$*
64 tar -C tmp-pristine-$* -jxf $<
65 -@rm tmp-pristine-$*/pax_global_header
66 mv tmp-pristine-$*/* $(@D)
67 @rm -rf tmp-pristine-$*
68 touch $(@D)/.hgskip
69 touch $@ # update timestamp to avoid rebuild
71 PATCHDIRS := $(wildcard patches/*-*)
73 ifneq ($(PATCHDIRS),)
74 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
76 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
77 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
79 clean::
80 rm -f patches/*/.makedep
82 ref-%/.valid-ref: pristine-%/.valid-pristine
83 set -e
84 rm -rf $(@D)
85 cp -al $(<D) $(@D)
86 if [ -d patches/$* ] ; then \
87 for i in patches/$*/*.patch ; do patch -d $(@D) -p1 <$$i || exit 1 ; done ; \
88 fi
89 touch $@ # update timestamp to avoid rebuild
90 endif
92 %-install:
93 $(MAKE) -f buildconfigs/mk.$* build
95 %-dist: DESTDIR=$(DISTDIR)/install
96 %-dist: %-install
97 @: # do nothing
99 # Legacy dist target
100 %-build: %-dist
101 @: # do nothing
103 %-delete:
104 $(MAKE) -f buildconfigs/mk.$* delete
106 %-clean:
107 $(MAKE) -f buildconfigs/mk.$* clean
109 %-config:
110 $(MAKE) -f buildconfigs/mk.$* config
112 %-xen.patch: ref-%/.valid-ref
113 rm -rf tmp-$@
114 cp -al $(<D) tmp-$@
115 ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
116 diff -Nurp $(<D) tmp-$@ > $@ || true
117 rm -rf tmp-$@
119 %-mrproper: %-mrproper-extra
120 rm -rf pristine-$(*)* ref-$(*)* $*.tar.bz2
121 rm -rf $*-xen.patch
123 netbsd-%-mrproper-extra:
124 rm -rf netbsd-$*-tools netbsd-$*-tools.tar.bz2
125 rm -f netbsd-$*-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
127 %-mrproper-extra:
128 @: # do nothing
130 config-update-pae:
131 ifeq ($(XEN_TARGET_X86_PAE),y)
132 sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
133 else
134 grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
135 endif
137 # never delete any intermediate files.
138 .SECONDARY: