[beast: 13/20] BUILD: Makefile.decl: simplify GITSTAMP by using git reflog entries



commit b01604df951de4648dc17aca89fceab7147dd3a7
Author: Tim Janik <timj gnu org>
Date:   Sun Jun 18 23:41:21 2017 +0200

    BUILD: Makefile.decl: simplify GITSTAMP by using git reflog entries
    
    Signed-off-by: Tim Janik <timj gnu org>

 Makefile.am                 |    2 +-
 Makefile.decl               |    8 +++-----
 docs/Makefile.am            |    2 +-
 tests/filecheck/Makefile.am |    2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d814c1f..2e0ef6f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,7 +60,7 @@ buildid:
 # == ChangeLog ==
 CHANGELOG_RANGE = $(shell git cat-file -e ce584d04999a7fb9393e1cfedde2048ba73e8878 && \
                    echo ce584d04999a7fb9393e1cfedde2048ba73e8878..HEAD || echo HEAD)
-ChangeLog: $(GITSTAMPS)
+ChangeLog: $(GITSTAMP)
        $(AM_V_GEN)
        $(Q) git log --pretty='^^%ad  %an       # %h%n%n%B%n' --first-parent \
                --abbrev=11 --date=short $(CHANGELOG_RANGE)   > xgen-$(@F) # Generate ChangeLog with 
^^-prefixed records
diff --git a/Makefile.decl b/Makefile.decl
index d5e87b9..788a244 100644
--- a/Makefile.decl
+++ b/Makefile.decl
@@ -17,13 +17,11 @@ QGEN    = $(Q:@=@echo '  GEN   ' $@; )
 QSTDERR = $(Q:@=2>/dev/null)
 QSTDOUT = $(Q:@=1>/dev/null)
 
-# == GITSTAMPS ==
+# == GITSTAMP ==
 # list of stamp files touched by commits
-GITSTAMPS = $(shell test -e "$${GIT_DIR:-.git}" && \
-               ls 2>/dev/null "$${GIT_DIR:-.git}/`git symbolic-ref -q HEAD || \
-               echo HEAD`" "$${GIT_DIR:-.git}/packed-refs" "$${GIT_DIR:-.git}/HEAD")
+GITSTAMP = $(shell G=$$(git rev-parse --git-dir 2>/dev/null); test -z "$$G" -o ! -e "$$G/logs/HEAD" || echo 
"$$G/logs/HEAD")
 
-# == download ==
+# == Download ==
 # recursive rule supported by all Makefiles to download files hosted online
 .PHONY: download download-recursive download-local
 download: download-local download-recursive
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 3f11bbd..db182ea 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -132,7 +132,7 @@ revisioned_files         = # files that need @FILE_REVISION@ substitution, see r
 
 # == revisions.lst ==
 noinst_DATA += revisions.lst
-revisions.lst: $(GITSTAMPS)
+revisions.lst: $(GITSTAMP)
        $(AM_V_GEN)
        $(Q) rm -f $@.tmplst
        $(Q) for file in $(revisioned_files) ; do \
diff --git a/tests/filecheck/Makefile.am b/tests/filecheck/Makefile.am
index 6e865a0..bd89030 100644
--- a/tests/filecheck/Makefile.am
+++ b/tests/filecheck/Makefile.am
@@ -14,7 +14,7 @@ SFIDL_INC = --nostdinc -I$(top_srcdir) -I$(top_builddir)
 # will load without any warnings or errors being issued. This is done
 # by first constructing the tarball file list via git ls-tree and then
 # filtering out bse files and finally trying to load these without warnings.
-bsefiles.list: $(GITSTAMPS)
+bsefiles.list: $(GITSTAMP)
        $(AM_V_GEN)
        $(Q) git ls-tree --name-only --full-tree -r HEAD > $@.tmp1
        $(Q) grep '\.bse$$' $@.tmp1 > $@.tmp2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]