ia64/xen-unstable

view buildconfigs/Rules.mk @ 11100:905ff6e616cc

[HVM] Add stubs to Linux for the new hvm_op hypercall.
Signed-off-by: Steven Smith <ssmith@xensource.com>
author kfraser@localhost.localdomain
date Mon Aug 14 11:33:50 2006 +0100 (2006-08-14)
parents 30cdeb686b93
children b53b154a5126
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 # Setup pristine search path
10 PRISTINE_SRC_PATH ?= .:..
11 vpath pristine-% $(PRISTINE_SRC_PATH)
13 # Let XEN_TARGET_ARCH override ARCH.
14 ifeq ($(XEN_TARGET_ARCH),x86_32)
15 LINUX_ARCH ?= i386
16 else
17 LINUX_ARCH ?= $(XEN_TARGET_ARCH)
18 endif
20 # Expand Linux series to Linux version
21 LINUX_SERIES ?= 2.6
22 LINUX_VER ?= $(shell grep "^LINUX_VER" buildconfigs/mk.linux-2.6-xen | sed -e 's/.*=[ ]*//')
24 # Setup Linux search path
25 LINUX_SRC_PATH ?= .:..
26 vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
27 vpath patch-%.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 patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 2,$(subst ., ,$(*F)))
36 patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, ,$(*F))),snapshots,testing)
37 patch-%.bz2:
38 @echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
39 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
41 pristine-%: pristine-%/.valid-pristine
42 @true
44 pristine-%/.valid-pristine: %.tar.bz2
45 rm -rf tmp-pristine-$* $(@D)
46 mkdir -p tmp-pristine-$*
47 tar -C tmp-pristine-$* -jxf $<
48 -@rm -f tmp-pristine-$*/pax_global_header
49 mv tmp-pristine-$*/* $(@D)
50 @rm -rf tmp-pristine-$*
51 touch $(@D)/.hgskip
52 touch $@ # update timestamp to avoid rebuild
54 PATCHDIRS := $(wildcard patches/*-*)
56 ifneq ($(PATCHDIRS),)
57 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
59 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
60 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
62 ref-%/.valid-ref: pristine-%/.valid-pristine
63 set -e
64 rm -rf $(@D)
65 cp -al $(<D) $(@D)
66 if [ -d patches/$* ] ; then \
67 for i in patches/$*/*.patch ; do patch -d $(@D) -p1 <$$i || exit 1 ; done ; \
68 fi
69 touch $@ # update timestamp to avoid rebuild
70 endif
72 %-install:
73 $(MAKE) -f buildconfigs/mk.$* build
75 %-dist: DESTDIR=$(DISTDIR)/install
76 %-dist: %-install
77 @: # do nothing
79 # Legacy dist target
80 %-build: %-dist
81 @: # do nothing
83 %-prep: DESTDIR=$(DISTDIR)/install
84 %-prep:
85 $(MAKE) -f buildconfigs/mk.$* prep
87 %-config: DESTDIR=$(DISTDIR)/install
88 %-config:
89 $(MAKE) -f buildconfigs/mk.$* config
91 %-delete:
92 $(MAKE) -f buildconfigs/mk.$* delete
94 %-clean:
95 $(MAKE) -f buildconfigs/mk.$* clean
97 linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
98 rm -rf tmp-$@
99 cp -al $(<D) tmp-$@
100 ( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
101 diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
102 rm -rf tmp-$@
104 %-xen.patch: ref-%/.valid-ref
105 rm -rf tmp-$@
106 cp -al $(<D) tmp-$@
107 ( cd $*-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
108 diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
109 rm -rf tmp-$@
111 %-mrproper:
112 $(MAKE) -f buildconfigs/mk.$*-xen mrpropper
113 rm -rf pristine-$(*)* ref-$(*)*
114 rm -rf $*-xen.patch
116 .PHONY: config-update-pae
117 config-update-pae:
118 ifeq ($(XEN_TARGET_X86_PAE),y)
119 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)
120 else
121 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
122 endif
124 # never delete any intermediate files.
125 .SECONDARY: