ia64/xen-unstable

annotate buildconfigs/mk.linux-2.6-xen @ 15257:00e0e2d7c156

Switch over to separate Linux tree.

The sparse tree is now deprecated and will deleted in due course. The
xen-unstable build system will automatically clone the correct Linux
tree for you and all the old makefile targets
(dist/linux-2.6-xen{,0,U}/etc) should continue to work.

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