ia64/xen-unstable

view buildconfigs/mk.linux-2.6-xen @ 15281:736e7cf0a3a5

Fix pv-on-hvm mkbuildtree script for new repo layout.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Jun 06 17:32:58 2007 +0100 (2007-06-06)
parents 20ee22a089ea
children c484106e44bd
line source
1 LINUX_SERIES = 2.6
2 LINUX_VER ?= 2.6.18
4 EXTRAVERSION ?= -xen
6 # Linux search path, will be searched for tarballs and mercurial
7 # repositories.
8 LINUX_SRC_PATH ?= .:..
10 XEN_LINUX_SOURCE ?= hg-clone
12 # Let XEN_TARGET_ARCH override ARCH.
13 ifeq ($(XEN_TARGET_ARCH),x86_32)
14 LINUX_ARCH ?= i386
15 else
16 LINUX_ARCH ?= $(XEN_TARGET_ARCH)
17 endif
19 LINUX_DIR = build-linux-$(LINUX_VER)$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
21 IMAGE_TARGET ?= vmlinuz
22 INSTALL_BOOT_PATH := $(DESTDIR)/boot
24 LINUX_VER3 := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
26 .PHONY: _build
27 _build: build
29 include buildconfigs/src.$(XEN_LINUX_SOURCE)
31 # The real action starts here!
32 .PHONY: build
33 build: $(LINUX_DIR)/include/linux/autoconf.h
34 ifneq ($(XEN_LINUX_ALLOW_INTERFACE_MISMATCH),y)
35 @if ! diff -urN -X buildconfigs/interface.exclude \
36 $(LINUX_SRCDIR)/include/xen/interface xen/include/public ; then \
37 echo "" 1>&2 ; \
38 echo " *** $(LINUX_SRCDIR)/include/xen/interface is out of date " 1>&2 ; \
39 echo " *** relative to $(XEN_ROOT)/xen/include/public." 1>&2 ; \
40 echo "" 1>&2 ; \
41 exit 1 ; \
42 fi
43 endif
44 if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
45 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules ; \
46 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
47 fi
48 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) $(IMAGE_TARGET)
49 mkdir -p $(INSTALL_BOOT_PATH)
50 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(INSTALL_BOOT_PATH) install
52 $(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(PWD)/$(LINUX_DIR)/.config
53 $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
54 rm -rf $(LINUX_DIR)
55 mkdir -p $(LINUX_DIR)
56 # Re-use config from install dir if one exists. Next try to use
57 # buildconfigs/create_config.sh is one is provided by the source
58 # tree. Finally attempt to use make defconfig.
59 set -e ; \
60 CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
61 if [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) ] ; then \
62 cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) $(CONFIG_FILE) ; \
63 elif [ -e $(LINUX_SRCDIR)/buildconfigs/create_config.sh ] ; then \
64 cd $(LINUX_SRCDIR) && sh buildconfigs/create_config.sh \
65 $(CONFIG_FILE) $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE) ; \
66 echo "Configured $(LINUX_DIR) using create_config.sh" ; \
67 elif $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) defconfig O=$$(/bin/pwd)/$(LINUX_DIR) ; then \
68 echo "Configured $(LINUX_DIR) using defconfig" ; \
69 else \
70 echo "No configuration method found for this kernel" ; \
71 fi
72 ifeq ($(XEN_TARGET_ARCH),x86_32)
73 ifeq ($(pae),y)
74 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)
75 else
76 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
77 endif
78 endif
79 ifneq ($(EXTRAVERSION),)
80 echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen
81 endif
82 $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR)
83 @if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
84 echo "***********************************"; \
85 echo "oldconfig did not create a Makefile"; \
86 echo "Generating $(LINUX_DIR)/Makefile "; \
87 echo "***********************************"; \
88 ( echo "# Automatically generated: don't edit"; \
89 echo ""; \
90 echo "VERSION = 2"; \
91 echo "PATCHLEVEL = 6"; \
92 echo ""; \
93 echo "KERNELSRC := $(PWD)/$(LINUX_SRCDIR)"; \
94 echo "KERNELOUTPUT := $(PWD)/$(LINUX_DIR)"; \
95 echo ""; \
96 echo "MAKEFLAGS += --no-print-directory"; \
97 echo ""; \
98 echo ".PHONY: all \$$(MAKECMDGOALS)"; \
99 echo ""; \
100 echo "all:"; \
101 echo " \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT)"; \
102 echo ""; \
103 echo "Makefile:;"; \
104 echo ""; \
105 echo "\$$(filter-out all Makefile,\$$(MAKECMDGOALS)) %/:"; \
106 echo " \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
107 ) > $(LINUX_DIR)/Makefile ; \
108 fi
110 .PHONY: prep
111 prep: $(LINUX_DIR)/include/linux/autoconf.h
113 .PHONY: config
114 config: CONFIGMODE = menuconfig
115 config: $(LINUX_DIR)/include/linux/autoconf.h
116 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) $(CONFIGMODE)
118 .PHONY: clean
119 clean::
120 [ ! -d $(LINUX_DIR) ] || \
121 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
123 .PHONY: delete
124 delete:
125 rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) $(LINUX_SRCDIR)
127 .PHONY: mrproper
128 mrproper:
129 rm -rf $(LINUX_SRCDIR)
130 rm -f linux-$(LINUX_VER).tar.bz2