From 4b97b30ffda91c7d0fa284e40a4f4e05f18b1f64 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 02 Aug 2012 08:01:56 -0400 Subject: Support @@DATE@@ build system macro in man pages. --- diff --git a/TODO b/TODO index 883fc9a..2b44f4c 100644 --- a/TODO +++ b/TODO @@ -12,8 +12,6 @@ For 2.0.0: * Finish documenting library functions. - Document standard output and error stream usage. * Document new utility interfaces. - * Update build system. - - Add a DATE macro for manual pages. Future Plans: * Check on file ownership and modes. 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 \ -- cgit v0.9.1