ia64/xen-unstable

view buildconfigs/mk.linux-2.6-common @ 16389:270bd0fc3669

xentrace: Fix TypeError handling of xentrace_format.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 16 17:05:20 2007 +0000 (2007-11-16)
parents cc58c6f3950e
children e2fa79c659e2
line source
1 LINUX_SERIES = 2.6
3 # Linux search path, will be searched for tarballs and mercurial
4 # repositories.
5 LINUX_SRC_PATH ?= .:..
7 # The source directory is not automatically updated to avoid blowing
8 # away developer's changes. If you want to automatically pull a new
9 # version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
10 # command line.
11 ifeq ($(XEN_LINUX_UPDATE),y)
12 __XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
13 else
14 __XEN_LINUX_UPDATE =
15 endif
17 # Let XEN_TARGET_ARCH override ARCH.
18 ifeq ($(XEN_TARGET_ARCH),x86_32)
19 LINUX_ARCH ?= i386
20 else
21 LINUX_ARCH ?= $(XEN_TARGET_ARCH)
22 endif
24 LINUX_DIR = build-linux-$(LINUX_VER)$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
26 IMAGE_TARGET ?= vmlinuz
27 ifneq ($(XEN_TARGET_ARCH),ia64)
28 IMAGE_PATH ?= arch/$(LINUX_ARCH)/boot/$(firstword $(IMAGE_TARGET))
29 else
30 IMAGE_PATH ?= arch/ia64/hp/sim/boot/vmlinux.gz
31 endif
32 INSTALL_BOOT_PATH := $(DESTDIR)/boot
34 LINUX_VER3 := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
36 .PHONY: _build
37 _build: build
39 include buildconfigs/src.$(XEN_LINUX_SOURCE)
41 # Default to allowing interface mismatch
42 ifndef XEN_LINUX_ALLOW_INTERFACE_MISMATCH
43 XEN_LINUX_ALLOW_INTERFACE_MISMATCH := y
44 endif
46 KERNELRELEASE = $(shell $(MAKE) -s --no-print-directory -C $(LINUX_DIR) kernelrelease)
48 # The real action starts here!
49 .PHONY: build
50 build: $(LINUX_DIR)/include/linux/autoconf.h
51 ifneq ($(XEN_LINUX_ALLOW_INTERFACE_MISMATCH),y)
52 @if ! diff -urN -X buildconfigs/interface.exclude \
53 $(LINUX_SRCDIR)/include/xen/interface xen/include/public ; then \
54 echo "" 1>&2 ; \
55 echo " *** $(LINUX_SRCDIR)/include/xen/interface is out of date " 1>&2 ; \
56 echo " *** relative to $(XEN_ROOT)/xen/include/public." 1>&2 ; \
57 echo "" 1>&2 ; \
58 exit 1 ; \
59 fi
60 endif
61 if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
62 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules ; \
63 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
64 fi
65 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) $(IMAGE_TARGET)
66 mkdir -p $(INSTALL_BOOT_PATH)
67 cp $(LINUX_DIR)/$(IMAGE_PATH) $(INSTALL_BOOT_PATH)/vmlinuz-$(KERNELRELEASE)
68 cp $(LINUX_DIR)/.config $(INSTALL_BOOT_PATH)/config-$(KERNELRELEASE)
69 cp $(LINUX_DIR)/System.map $(INSTALL_BOOT_PATH)/System.map-$(KERNELRELEASE)
71 $(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(CURDIR)/$(LINUX_DIR)/.config
72 $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
73 rm -rf $(LINUX_DIR)
74 mkdir -p $(LINUX_DIR)
75 # Re-use config from install dir if one exists. Next try to use
76 # buildconfigs/create_config.sh is one is provided by the source
77 # tree. Finally attempt to use make defconfig.
78 set -e ; \
79 CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
80 if [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) ] ; then \
81 cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) $(CONFIG_FILE) ; \
82 elif [ -e $(LINUX_SRCDIR)/buildconfigs/create_config.sh ] ; then \
83 cd $(LINUX_SRCDIR) && sh buildconfigs/create_config.sh \
84 $(CONFIG_FILE) $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE) ; \
85 echo "Configured $(LINUX_DIR) using create_config.sh" ; \
86 elif $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) defconfig O=$$(/bin/pwd)/$(LINUX_DIR) ; then \
87 echo "Configured $(LINUX_DIR) using defconfig" ; \
88 else \
89 echo "No configuration method found for this kernel" ; \
90 fi
91 ifneq ($(XEN_LINUX_CONFIG_UPDATE),)
92 echo "Updating $(CONFIG_FILE) using $(XEN_LINUX_CONFIG_UPDATE)"
93 sh $(XEN_LINUX_CONFIG_UPDATE) $(CONFIG_FILE)
94 endif
95 ifeq ($(XEN_TARGET_ARCH),x86_32)
96 ifeq ($(pae),y)
97 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)
98 else
99 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
100 endif
101 endif
102 ifneq ($(EXTRAVERSION),)
103 echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen
104 endif
105 $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR)
106 @if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
107 echo "***********************************"; \
108 echo "oldconfig did not create a Makefile"; \
109 echo "Generating $(LINUX_DIR)/Makefile "; \
110 echo "***********************************"; \
111 ( echo "# Automatically generated: don't edit"; \
112 echo ""; \
113 echo "VERSION = 2"; \
114 echo "PATCHLEVEL = 6"; \
115 echo ""; \
116 echo "KERNELSRC := $(CURDIR)/$(LINUX_SRCDIR)"; \
117 echo "KERNELOUTPUT := $(CURDIR)/$(LINUX_DIR)"; \
118 echo ""; \
119 echo "MAKEFLAGS += --no-print-directory"; \
120 echo ""; \
121 echo ".PHONY: all \$$(MAKECMDGOALS)"; \
122 echo ""; \
123 echo "all:"; \
124 echo " \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT)"; \
125 echo ""; \
126 echo "Makefile:;"; \
127 echo ""; \
128 echo "\$$(filter-out all Makefile,\$$(MAKECMDGOALS)) %/:"; \
129 echo " \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
130 ) > $(LINUX_DIR)/Makefile ; \
131 fi
132 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) prepare
134 .PHONY: prep
135 prep: $(LINUX_DIR)/include/linux/autoconf.h
137 .PHONY: config
138 config: CONFIGMODE = menuconfig
139 config: $(LINUX_DIR)/include/linux/autoconf.h
140 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) $(CONFIGMODE)
142 .PHONY: clean
143 clean::
144 [ ! -d $(LINUX_DIR) ] || \
145 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
147 .PHONY: delete
148 delete:
149 rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) $(LINUX_SRCDIR)
151 .PHONY: mrproper
152 mrproper:
153 rm -rf $(LINUX_SRCDIR)
154 rm -f linux-$(LINUX_VER).tar.bz2
156 .PHONY: $(LINUX_SRCDIR)/.force-update
157 $(LINUX_SRCDIR)/.force-update:
158 @ :