ia64/xen-unstable

view buildconfigs/mk.linux-2.6-xen @ 15776:ae923d1f50bf

Linux 2.6.18 doesn't create include/linux/autoconf.h as a side effect
of make oldconfig. Use silentoldconfig instead.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Fri Aug 17 13:30:05 2007 +0100 (2007-08-17)
parents a1b6555a37bf
children 8ef276326042
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 # The source directory is not automatically updated to avoid blowing
11 # away developer's changes. If you want to automatically pull a new
12 # version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
13 # command line.
14 ifeq ($(XEN_LINUX_UPDATE),y)
15 __XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
16 else
17 __XEN_LINUX_UPDATE =
18 endif
20 XEN_LINUX_SOURCE ?= hg-clone
22 # Let XEN_TARGET_ARCH override ARCH.
23 ifeq ($(XEN_TARGET_ARCH),x86_32)
24 LINUX_ARCH ?= i386
25 else
26 LINUX_ARCH ?= $(XEN_TARGET_ARCH)
27 endif
29 LINUX_DIR = build-linux-$(LINUX_VER)$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
31 IMAGE_TARGET ?= vmlinuz
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 # The real action starts here!
47 .PHONY: build
48 build: $(LINUX_DIR)/include/linux/autoconf.h
49 ifneq ($(XEN_LINUX_ALLOW_INTERFACE_MISMATCH),y)
50 @if ! diff -urN -X buildconfigs/interface.exclude \
51 $(LINUX_SRCDIR)/include/xen/interface xen/include/public ; then \
52 echo "" 1>&2 ; \
53 echo " *** $(LINUX_SRCDIR)/include/xen/interface is out of date " 1>&2 ; \
54 echo " *** relative to $(XEN_ROOT)/xen/include/public." 1>&2 ; \
55 echo "" 1>&2 ; \
56 exit 1 ; \
57 fi
58 endif
59 if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
60 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules ; \
61 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
62 fi
63 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) $(IMAGE_TARGET)
64 mkdir -p $(INSTALL_BOOT_PATH)
65 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(INSTALL_BOOT_PATH) install
67 $(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(CURDIR)/$(LINUX_DIR)/.config
68 $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
69 rm -rf $(LINUX_DIR)
70 mkdir -p $(LINUX_DIR)
71 # Re-use config from install dir if one exists. Next try to use
72 # buildconfigs/create_config.sh is one is provided by the source
73 # tree. Finally attempt to use make defconfig.
74 set -e ; \
75 CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
76 if [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) ] ; then \
77 cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) $(CONFIG_FILE) ; \
78 elif [ -e $(LINUX_SRCDIR)/buildconfigs/create_config.sh ] ; then \
79 cd $(LINUX_SRCDIR) && sh buildconfigs/create_config.sh \
80 $(CONFIG_FILE) $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE) ; \
81 echo "Configured $(LINUX_DIR) using create_config.sh" ; \
82 elif $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) defconfig O=$$(/bin/pwd)/$(LINUX_DIR) ; then \
83 echo "Configured $(LINUX_DIR) using defconfig" ; \
84 else \
85 echo "No configuration method found for this kernel" ; \
86 fi
87 ifneq ($(XEN_LINUX_CONFIG_UPDATE),)
88 echo "Updating $(CONFIG_FILE) using $(XEN_LINUX_CONFIG_UPDATE)"
89 sh $(XEN_LINUX_CONFIG_UPDATE) $(CONFIG_FILE)
90 endif
91 ifeq ($(XEN_TARGET_ARCH),x86_32)
92 ifeq ($(pae),y)
93 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)
94 else
95 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
96 endif
97 endif
98 ifneq ($(EXTRAVERSION),)
99 echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen
100 endif
101 $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) silentoldconfig O=$$(/bin/pwd)/$(LINUX_DIR)
102 @if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
103 echo "*****************************************"; \
104 echo "silentoldconfig did not create a Makefile"; \
105 echo "Generating $(LINUX_DIR)/Makefile "; \
106 echo "*****************************************"; \
107 ( echo "# Automatically generated: don't edit"; \
108 echo ""; \
109 echo "VERSION = 2"; \
110 echo "PATCHLEVEL = 6"; \
111 echo ""; \
112 echo "KERNELSRC := $(CURDIR)/$(LINUX_SRCDIR)"; \
113 echo "KERNELOUTPUT := $(CURDIR)/$(LINUX_DIR)"; \
114 echo ""; \
115 echo "MAKEFLAGS += --no-print-directory"; \
116 echo ""; \
117 echo ".PHONY: all \$$(MAKECMDGOALS)"; \
118 echo ""; \
119 echo "all:"; \
120 echo " \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT)"; \
121 echo ""; \
122 echo "Makefile:;"; \
123 echo ""; \
124 echo "\$$(filter-out all Makefile,\$$(MAKECMDGOALS)) %/:"; \
125 echo " \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
126 ) > $(LINUX_DIR)/Makefile ; \
127 fi
129 .PHONY: prep
130 prep: $(LINUX_DIR)/include/linux/autoconf.h
132 .PHONY: config
133 config: CONFIGMODE = menuconfig
134 config: $(LINUX_DIR)/include/linux/autoconf.h
135 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) $(CONFIGMODE)
137 .PHONY: clean
138 clean::
139 [ ! -d $(LINUX_DIR) ] || \
140 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
142 .PHONY: delete
143 delete:
144 rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) $(LINUX_SRCDIR)
146 .PHONY: mrproper
147 mrproper:
148 rm -rf $(LINUX_SRCDIR)
149 rm -f linux-$(LINUX_VER).tar.bz2
151 .PHONY: $(LINUX_SRCDIR)/.force-update
152 $(LINUX_SRCDIR)/.force-update:
153 @ :