build: Do not always regenerate the version.h file
[sfrench/samba-autobuild/.git] / buildtools / wafsamba / samba_patterns.py
index 4db5eea7d69858f72f2952bb23546c508cf2fbb8..55ed540670c176f0b0c0f8ea60f870eaab5f28e1 100644 (file)
@@ -21,11 +21,15 @@ def write_version_header(task):
 
 def SAMBA_MKVERSION(bld, target):
     '''generate the version.h header for Samba'''
+
+    # We only force waf to re-generate this file if we are installing,
+    # because only then is information not included in the deps (the
+    # git revision) included in the version.
     t = bld.SAMBA_GENERATOR('VERSION',
                             rule=write_version_header,
                             source= 'VERSION',
                             target=target,
-                            always=True)
+                            always=bld.is_install)
     t.env.is_install = bld.is_install
 Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION