|
From: sfeam <sf...@us...> - 2017-12-25 21:56:13
|
On Monday, 25 December 2017 22:08:24 Bastian Märkisch wrote:
> > Building from git tip fails to insert a valid date into
> > the "last modified" field. This used to be pulled from the
> > top of ChangeLog and inserted into timestamp.h but that
> > mechanism does not track the date of git commits.
>
> That might do the trick:
> git log -1 --format=%ci | cut -b-10
>
> Bastian
That looks promising.
Can someone wrap that in the appropriate Makefile syntax to
substitute for the rule currently in src/Makefile.am?
timestamp.h: $(top_srcdir)/ChangeLog Makefile
@echo Making $@
@echo "#ifndef GNUPLOT_TIMEBASE_H_INCLUDED" >$@t
@echo "#define GNUPLOT_TIMEBASE_H_INCLUDED" >>$@t
@head -1 $< | sed -e 's,\(^[0-9-]* \).*$$,const char gnuplot_date[] = "\1";,' >>$@t
@echo "#endif /* GNUPLOT_TIMEBASE_H_INCLUDED */" >> $@t
@if cmp -s $@ $@t; then rm -f $@t; else mv $@t $@; fi
I suppose the dependency rule would become something like
timestamp.h: $(top_srcdir)/.git/objects Makefile
but how does one get "make" to track the change status of .git/objects ?
Ethan
|