ia64/xen-unstable

view buildconfigs/mk.linux-2.6-xen0 @ 5866:22984cc20ff9

Manual merge.
author kaf24@firebug.cl.cam.ac.uk
date Tue Jul 26 16:17:04 2005 +0000 (2005-07-26)
parents a83ac0806d6b
children 4c52791a0444 b53a65034532
line source
2 OS = linux
4 LINUX_SERIES = 2.6
5 LINUX_VER = 2.6.12
7 EXTRAVERSION = xen0
9 LINUX_DIR = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
11 include buildconfigs/Rules.mk
13 .PHONY: build clean delete
15 # The real action starts here!
16 build: $(LINUX_DIR)/include/linux/autoconf.h
17 if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
18 $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \
19 $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
20 fi
21 $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install
23 $(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
24 rm -rf $(LINUX_DIR)
25 cp -al $(<D) $(LINUX_DIR)
26 # Apply arch-xen patches
27 ( cd linux-$(LINUX_SERIES)-xen-sparse ; \
28 ./mkbuildtree ../$(LINUX_DIR) )
29 # Re-use config from install dir if one exits else use default config
30 CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
31 [ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
32 cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) $(LINUX_DIR)/.config \
33 || cp $(LINUX_DIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(XEN_TARGET_ARCH) \
34 $(LINUX_DIR)/.config
35 # Patch kernel Makefile to set EXTRAVERSION
36 ( cd $(LINUX_DIR) ; \
37 sed -e 's/^EXTRAVERSION.*/&$$(XENGUEST)\nXENGUEST = -$(EXTRAVERSION)/' Makefile >Mk.tmp ; \
38 rm -f Makefile ; mv Mk.tmp Makefile )
39 $(MAKE) -C $(LINUX_DIR) ARCH=xen oldconfig
41 config: CONFIGMODE = menuconfig
42 config: $(LINUX_DIR)/include/linux/autoconf.h
43 $(MAKE) -C $(LINUX_DIR) ARCH=xen $(CONFIGMODE)
45 clean::
46 $(MAKE) -C $(LINUX_DIR) ARCH=xen clean
48 delete:
49 rm -rf tmp-$(OS)-$(LINUX_VER) $(LINUX_DIR)