ia64/xen-unstable

view buildconfigs/src.hg-clone @ 15270:c09dbe98e4d6

If we find a Linux repository in $(LINUX_SRC_PATH) then symlink it
instead of cloning it. This enables developers to keep a linux tree
separate to their xen repository and to make changes there which are
picked up by the Xen build.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Mon Jun 04 15:41:32 2007 +0100 (2007-06-04)
parents f6ff5d42164f
children 23460646912e
line source
1 # Mercurial
2 HG ?= hg
4 LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.hg
6 # Repository to clone.
7 XEN_LINUX_HGREPO ?= $$(sh buildconfigs/select-repository $(LINUX_SRCDIR) $(LINUX_SRC_PATH))
9 # The source directory is not automatically updated to avoid blowing
10 # away developer's changes. If you want to automatically pull a new
11 # version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
12 # command line.
13 ifeq ($(XEN_LINUX_UPDATE),y)
14 __XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
15 else
16 __XEN_LINUX_UPDATE =
17 endif
19 # Set XEN_LINUX_HGREV to update to a particlar revision.
20 XEN_LINUX_HGREV ?= tip
22 $(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE)
23 set -e ; \
24 if [ ! -e $(LINUX_SRCDIR)/.hg ] ; then \
25 __repo=$(XEN_LINUX_HGREPO) ; \
26 if [ -d $${__repo} ] ; then \
27 echo "Linking $${__repo} to $(LINUX_SRCDIR)." ; \
28 ln -s $${__repo} $(LINUX_SRCDIR) ; \
29 else \
30 echo "Cloning $${__repo} to $(LINUX_SRCDIR)." ; \
31 $(HG) clone $${__repo} $(LINUX_SRCDIR) ; \
32 fi ; \
33 else \
34 __parent=$$($(HG) -R $(LINUX_SRCDIR) path default) ; \
35 echo "Pulling changes from $${__parent} into $(LINUX_SRCDIR)." ; \
36 $(HG) -R $(LINUX_SRCDIR) pull $${__parent} ; \
37 fi
38 if [ -n "$(XEN_LINUX_HGREV)" ] ; then \
39 echo "Updating $(LINUX_SRCDIR) to revision $(XEN_LINUX_HGREV)." ; \
40 ( cd $(LINUX_SRCDIR) && $(HG) update $(XEN_LINUX_HGREV) ); \
41 fi
42 touch $@
44 .PHONY: $(LINUX_SRCDIR)/.force-update
45 $(LINUX_SRCDIR)/.force-update:
46 @ :