ia64/xen-unstable

view buildconfigs/Rules.mk @ 6012:04dfb5158f3a

Merge.
author kaf24@firebug.cl.cam.ac.uk
date Wed Aug 03 09:27:27 2005 +0000 (2005-08-03)
parents d4fd332df775 8803b4adf164
children f294acb25858
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-%: pristine-%/.valid-pristine
55 @true
57 pristine-%/.valid-pristine: %.tar.bz2
58 rm -rf tmp-pristine-$* $(@D)
59 mkdir -p tmp-pristine-$*
60 tar -C tmp-pristine-$* -jxf $<
61 -@rm tmp-pristine-$*/pax_global_header
62 mv tmp-pristine-$*/* $(@D)
63 @rm -rf tmp-pristine-$*
64 touch $(@D)/.hgskip
65 touch $@ # update timestamp to avoid rebuild
67 PATCHDIRS := $(wildcard patches/*-*)
69 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
71 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
72 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
74 clean::
75 rm -f patches/*/.makedep
77 ref-%/.valid-ref: pristine-%/.valid-pristine
78 rm -rf $(@D)
79 cp -al $(<D) $(@D)
80 ([ -d patches/$* ] && \
81 for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
82 touch $@ # update timestamp to avoid rebuild
84 %-build:
85 $(MAKE) -f buildconfigs/mk.$* build
87 %-delete:
88 $(MAKE) -f buildconfigs/mk.$* delete
90 %-clean:
91 $(MAKE) -f buildconfigs/mk.$* clean
93 %-config:
94 $(MAKE) -f buildconfigs/mk.$* config
96 %-xen.patch: ref-%/.valid-ref
97 rm -rf tmp-$@
98 cp -al $(<D) tmp-$@
99 ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
100 diff -Nurp $(<D) tmp-$@ > $@ || true
101 rm -rf tmp-$@
103 %-mrproper: %-mrproper-extra
104 rm -rf pristine-$(*)* ref-$(*)* $*.tar.bz2
105 rm -rf $*-xen.patch
107 netbsd-%-mrproper-extra:
108 rm -rf netbsd-$*-tools netbsd-$*-tools.tar.bz2
109 rm -f netbsd-$*-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
111 %-mrproper-extra:
112 @: # do nothing
114 config-update-pae:
115 ifeq ($(XEN_TARGET_X86_PAE),y)
116 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)
117 else
118 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
119 endif
121 # never delete any intermediate files.
122 .SECONDARY: