ia64/xen-unstable

view buildconfigs/Rules.mk @ 7337:d61142fc7480

Fix reprogram_ac_timer corner case bug, by Tristan Gingold
author djm@kirby.fc.hp.com
date Fri Oct 14 14:11:12 2005 -0600 (2005-10-14)
parents 74d56b7ff46c
children 4dd58ef39639
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 rm -rf $(@D)
84 cp -al $(<D) $(@D)
85 ([ -d patches/$* ] && \
86 for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
87 touch $@ # update timestamp to avoid rebuild
88 endif
90 %-install:
91 $(MAKE) -f buildconfigs/mk.$* build
93 %-dist: DESTDIR=$(DISTDIR)/install
94 %-dist: %-install
95 @: # do nothing
97 # Legacy dist target
98 %-build: %-dist
99 @: # do nothing
101 %-delete:
102 $(MAKE) -f buildconfigs/mk.$* delete
104 %-clean:
105 $(MAKE) -f buildconfigs/mk.$* clean
107 %-config:
108 $(MAKE) -f buildconfigs/mk.$* config
110 %-xen.patch: ref-%/.valid-ref
111 rm -rf tmp-$@
112 cp -al $(<D) tmp-$@
113 ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
114 diff -Nurp $(<D) tmp-$@ > $@ || true
115 rm -rf tmp-$@
117 %-mrproper: %-mrproper-extra
118 rm -rf pristine-$(*)* ref-$(*)* $*.tar.bz2
119 rm -rf $*-xen.patch
121 netbsd-%-mrproper-extra:
122 rm -rf netbsd-$*-tools netbsd-$*-tools.tar.bz2
123 rm -f netbsd-$*-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
125 %-mrproper-extra:
126 @: # do nothing
128 config-update-pae:
129 ifeq ($(XEN_TARGET_X86_PAE),y)
130 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)
131 else
132 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
133 endif
135 # never delete any intermediate files.
136 .SECONDARY: