diff options
author | P. J. McDermott <pjm@nac.net> | 2012-08-02 08:01:56 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-08-02 08:05:27 (EDT) |
commit | 4b97b30ffda91c7d0fa284e40a4f4e05f18b1f64 (patch) | |
tree | cb6e5f58a8fcbc5d51b79027b1f12b905fd3af8d /man | |
parent | 41cb214c4534ac933384aab1153bbd8d8dd49ed8 (diff) |
Support @@DATE@@ build system macro in man pages.
Diffstat (limited to 'man')
-rw-r--r-- | man/Makefile.in | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/man/Makefile.in b/man/Makefile.in index e68ccce..c44c67e 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -45,7 +45,17 @@ all: $(OBJS) $(OBJS): @printf ' SED man/%s\n' '$@' - @sed '$(sed_script)' '$(srcdir)/man/$@.in' >'$@' + @abmon='Nul Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec '; \ + date=$$(LC_TIME=POSIX ls -l $(srcdir)/man/$@.in | sed 's/ / /g' | \ + cut -d ' ' -f 6-8); \ + md="$${date% *}"; \ + m="$$(echo $${abmon% $${md% *} *} | wc -w)"; \ + d="$${md#* }"; \ + [ $${m} -lt 10 ] && m="0$${m}"; \ + [ $${d} -lt 10 ] && d="0$${d}"; \ + y="$${date##* }"; \ + [ "$${y%:*}" != "$${y}" ] && y=$$(date '+%Y'); \ + sed "$(sed_script) s&@@DATE@@&$${y}-$${m}-$${d}&;" '$(srcdir)/man/$@.in' >'$@' clean: @for obj in $(OBJS); do \ |