1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Conditionalise the automake git-commit embedding.

This arranges that the mechanism from the previous commit
automatically turns itself on and off depending on whether a .git
directory even exists (so it won't try to do anything in distribution
tarballs), and also arranges that it can be manually turned off by a
configure option (in case someone who _is_ building from a git
checkout finds it inconvenient for some reason I haven't thought of,
which seems quite plausible to me).
This commit is contained in:
Simon Tatham
2017-01-21 14:57:31 +00:00
parent be586d53b0
commit 19aefec3e8
2 changed files with 16 additions and 2 deletions

6
Recipe
View File

@ -134,13 +134,15 @@
# ------------------------------------------------------------
# Additional text added verbatim to each individual Makefile.
!cflags am version -DSOURCE_COMMIT=\"`git rev-parse HEAD 2>/dev/null`\"
!cflags am version
!begin am
if AUTO_GIT_COMMIT
BUILT_SOURCES = empty.h
CLEANFILES = empty.h
libversion_a_CFLAGS += -DSOURCE_COMMIT=\"`git --git-dir=$(srcdir)/.git rev-parse HEAD 2>/dev/null`\"
empty.h: $(allsources)
echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@
endif
!end
!begin >empty.h
/* Empty file touched by automake makefile to force rebuild of version.o */