From aaebf4332018980fef4e601d1b5a6e52dd9e9ae4 Mon Sep 17 00:00:00 2001 From: Ryan Anderson Date: Sun, 31 Jul 2005 04:57:49 -0400 Subject: [PATCH] kbuild: automatically append a short string to the version based upon the git commit If CONFIG_AUTO_LOCALVERSION is set, the user is using a git-based tree, and the current HEAD is not referred to by any tags in .git/refs/tags/, append -g and the first 8 characters of the commit to the version string. This makes it easier to use git-bisect, and/or to do a daily build, without trampling on your older, working builds, or accidentally setting up conflicting sets of modules. Signed-off-by: Ryan Anderson Signed-off-by: Sam Ravnborg --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d01b004a2a0..c6aae86a02c 100644 --- a/Makefile +++ b/Makefile @@ -548,6 +548,26 @@ export KBUILD_IMAGE ?= vmlinux # images. Default is /boot, but you can set it to other values export INSTALL_PATH ?= /boot +# If CONFIG_LOCALVERSION_AUTO is set, we automatically perform some tests +# and try to determine if the current source tree is a release tree, of any sort, +# or if is a pure development tree. +# +# A 'release tree' is any tree with a git TAG associated +# with it. The primary goal of this is to make it safe for a native +# git/CVS/SVN user to build a release tree (i.e, 2.6.9) and also to +# continue developing against the current Linus tree, without having the Linus +# tree overwrite the 2.6.9 tree when installed. +# +# Currently, only git is supported. +# Other SCMs can edit scripts/setlocalversion and add the appropriate +# checks as needed. + + +ifdef CONFIG_LOCALVERSION_AUTO + localversion-auto := $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree)) + LOCALVERSION := $(LOCALVERSION)$(localversion-auto) +endif + # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory # relocations required by build roots. This is not defined in the -- cgit v1.2.3