]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - Makefile
kbuild: fix 'make rpm' when CONFIG_LOCALVERSION_AUTO=y and using SCM tree
[linux-2.6-omap-h63xx.git] / Makefile
index d04ee0ad1dccce7ea2503637ffbe6d8753074ffe..55424172bea40d820c1e2d1924df19f682445ccb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -904,12 +904,18 @@ localver = $(subst $(space),, $(string) \
 # and if the SCM is know a tag from the SCM is appended.
 # The appended tag is determined by the SCM used.
 #
-# Currently, only git is supported.
-# Other SCMs can edit scripts/setlocalversion and add the appropriate
-# checks as needed.
+# .scmversion is used when generating rpm packages so we do not loose
+# the version information from the SCM when we do the build of the kernel
+# from the copied source
 ifdef CONFIG_LOCALVERSION_AUTO
-       _localver-auto = $(shell $(CONFIG_SHELL) \
-                         $(srctree)/scripts/setlocalversion $(srctree))
+
+ifeq ($(wildcard .scmversion),)
+        _localver-auto = $(shell $(CONFIG_SHELL) \
+                         $(srctree)/scripts/setlocalversion $(srctree))
+else
+        _localver-auto = $(shell cat .scmversion 2> /dev/null)
+endif
+
        localver-auto  = $(LOCALVERSION)$(_localver-auto)
 endif