ia64/xen-unstable

view buildconfigs/mk.linux-2.6-xen @ 9123:a0c07e32000a

Minor enhancements to gdbbuild, the build script for gdbserver-xen.
1. Use $MAKE if set
2. Make mirror configurable from environment

From: Horms <horms@verge.net.au>

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 03 11:17:09 2006 +0100 (2006-03-03)
parents 3b74edc512b4
children ea67b8a9c7e0
line source
2 OS = linux
4 LINUX_SERIES = 2.6
5 LINUX_VER = 2.6.16-rc5
6 LINUX_SRCS = linux-2.6.15.tar.bz2 patch-2.6.16-rc5.bz2
7 LINUX_PDIR = linux-$(LINUX_VER)
9 EXTRAVERSION ?= xen
11 LINUX_DIR = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
13 include buildconfigs/Rules.mk
15 .PHONY: build clean delete
17 # The real action starts here!
18 build: $(LINUX_DIR)/include/linux/autoconf.h
19 if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
20 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules ; \
21 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
22 fi
23 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) vmlinuz
24 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) install
26 pristine-$(LINUX_PDIR)/.valid-srcs: $(LINUX_SRCS)
27 rm -rf tmp-pristine-$(LINUX_PDIR) $(@D)
28 mkdir -p tmp-pristine-$(LINUX_PDIR)
29 tar -C tmp-pristine-$(LINUX_PDIR) -jxf $<
30 -@rm tmp-pristine-$(LINUX_PDIR)/pax_global_header
31 mv tmp-pristine-$(LINUX_PDIR)/* $(@D)
32 @rm -rf tmp-pristine-$(LINUX_PDIR)
33 bzcat $(wordlist 2,$(words $^),$^) | patch -d $(@D) -p1
34 touch $(@D)/.hgskip
35 touch $@
37 pristine-linux-%.16-rc5/.valid-pristine: pristine-$(LINUX_PDIR)/.valid-srcs
38 touch $@ # update timestamp to avoid rebuild
40 $(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
41 rm -rf $(LINUX_DIR)
42 cp -al $(<D) $(LINUX_DIR)
43 # Apply arch-xen patches
44 ( cd linux-$(LINUX_SERIES)-xen-sparse ; \
45 LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_DIR) )
46 # Re-use config from install dir if one exits else use default config
47 CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
48 [ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
49 cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) $(LINUX_DIR)/.config \
50 || cp buildconfigs/linux-defconfig_$(EXTRAVERSION)_$(XEN_TARGET_ARCH)$(XEN_SYSTYPE) \
51 $(LINUX_DIR)/.config
52 # See if we need to munge config to enable PAE
53 $(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk config-update-pae
54 # Patch kernel Makefile to set EXTRAVERSION
55 ( cd $(LINUX_DIR) ; \
56 sed -e 's/^EXTRAVERSION.*/&$$(XENGUEST)\nXENGUEST = -$(EXTRAVERSION)/' Makefile >Mk.tmp ; \
57 rm -f Makefile ; mv Mk.tmp Makefile )
58 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) oldconfig
60 prep: $(LINUX_DIR)/include/linux/autoconf.h
62 config: CONFIGMODE = menuconfig
63 config: $(LINUX_DIR)/include/linux/autoconf.h
64 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) $(CONFIGMODE)
66 clean::
67 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
69 delete:
70 rm -rf tmp-$(OS)-$(LINUX_VER) $(LINUX_DIR)