diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | man/Makefile.in | 12 |
2 files changed, 11 insertions, 3 deletions
@@ -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 \ |