]> err.no Git - linux-2.6/commitdiff
[PATCH] kbuild: adjust .version updating
authorJan Beulich <JBeulich@novell.com>
Thu, 8 Sep 2005 15:07:35 +0000 (17:07 +0200)
committerSam Ravnborg <sam@mars.ravnborg.org>
Sat, 10 Sep 2005 12:17:45 +0000 (14:17 +0200)
In order to maintain a more correct build number, updates to the
version
number should only be commited after a successful link of vmlinux, not
before (so that errors in the link process don't lead to pointless
increments).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Makefile

index 6a405882b1f7e88e145a3de3e55e2e819143acaa..485a11a1985f90adf0ffd3c4a6be3f3f60a04595 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -641,8 +641,13 @@ quiet_cmd_vmlinux__ ?= LD      $@
 # Generate new vmlinux version
 quiet_cmd_vmlinux_version = GEN     .version
       cmd_vmlinux_version = set -e;                     \
-       . $(srctree)/scripts/mkversion > .tmp_version;  \
-       mv -f .tmp_version .version;                    \
+       if [ ! -r .version ]; then                      \
+         rm -f .version;                               \
+         echo 1 >.version;                             \
+       else                                            \
+         mv .version .old_version;                     \
+         expr 0$$(cat .old_version) + 1 >.version;     \
+       fi;                                             \
        $(MAKE) $(build)=init
 
 # Generate System.map
@@ -756,6 +761,7 @@ endif # ifdef CONFIG_KALLSYMS
 # vmlinux image - including updated kernel symbols
 vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
        $(call if_changed_rule,vmlinux__)
+       $(Q)rm -f .old_version
 
 # The actual objects are generated when descending, 
 # make sure no implicit rule kicks in