]> git.lyx.org Git - features.git/commitdiff
Fix generation of lyx_commit_hash.h
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 10 Mar 2015 18:11:48 +0000 (19:11 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 10 Mar 2015 18:13:06 +0000 (19:13 +0100)
Now version.o is not recompiled on already built tree.

src/Makefile.am

index 9b6b5384c69e110bf1ad2441b095db498efa7c2d..6df58588d9d8edfbb7c23e2f400e5f2aa128bb9e 100644 (file)
@@ -305,11 +305,23 @@ HEADERFILESCORE = \
 STANDALONEFILES = \
        Layout.cpp
 
-.PHONY: lyx_commit_hash.h
 
-lyx_commit_hash.h:
-       $(AM_V_GEN)hash=`cd "$(top_srcdir)" && git log -1 --pretty=format:%H 2>/dev/null || echo none` ; \
-        sed s/@LYX_GIT_COMMIT_HASH@/$$hash/ "$(srcdir)"/lyx_commit_hash.h.in >$@
+.PHONY: update_commit_hash
+
+LCH_V_GEN = $(lch__v_GEN_@AM_V@)
+lch__v_GEN_ = $(lch__v_GEN_@AM_DEFAULT_V@)
+lch__v_GEN_0 = @echo "  GEN      lyx_commit_hash.h";
+lch__v_GEN_1 =
+
+update_commit_hash:
+       rm -f hash-temp \
+       $(LCH_V_GEN)hash=`cd "$(top_srcdir)" && git log -1 --pretty=format:%H 2>/dev/null || echo none` ; \
+       sed s/@LYX_GIT_COMMIT_HASH@/$$hash/ "$(srcdir)"/lyx_commit_hash.h.in >hash-temp ; \
+       cmp -s lyx_commit_hash.h hash-temp || cp hash-temp lyx_commit_hash.h ; \
+       rm -f hash-temp
+
+lyx_commit_hash.h: update_commit_hash
+
 BUILT_SOURCES += lyx_commit_hash.h
 CLEANFILES += lyx_commit_hash.h