about summary refs log tree commit homepage
path: root/Documentation/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/GNUmakefile')
-rw-r--r--Documentation/GNUmakefile27
1 files changed, 23 insertions, 4 deletions
diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
index 9e92de2..6db8d49 100644
--- a/Documentation/GNUmakefile
+++ b/Documentation/GNUmakefile
@@ -3,9 +3,15 @@
 all::
 
 INSTALL = install
-PANDOC = pandoc
+POD2MAN = pod2man
+-include ../GIT-VERSION-FILE
+release := yahns $(VERSION)
 PANDOC_OPTS = -f markdown --email-obfuscation=none
-pandoc = $(PANDOC) $(PANDOC_OPTS)
+POD2MAN_OPTS = -v -r '$(release)' --stderr -d 1994-10-02 -c 'yahns user manual'
+pod2man = $(POD2MAN) $(POD2MAN_OPTS)
+POD2TEXT = pod2text
+POD2TEXT_OPTS = --stderr
+pod2text = $(POD2TEXT) $(POD2TEXT_OPTS)
 
 m1 =
 m1 += yahns
@@ -43,8 +49,21 @@ install-man: man
         $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
         $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
         test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
-%.1 %.5 %.7 : %.txt
-        $(pandoc) -s -t man < $< > $@+ && mv $@+ $@
+
+%.1 %.5 %.7 : %.pod
+        $(pod2man) -s $(subst .,,$(suffix $@)) $< $@+ && mv $@+ $@
+
+mantxt = $(addsuffix .txt, $(m1) $(m5) $(m7))
+
+txt :: $(mantxt)
+
+all :: txt
+
+%.txt : %.pod
+        $(pod2text) $< $@+
+        -touch -r $< $@+ 2>/dev/null # GNU-ism
+        mv $@+ $@
 
 clean::
         $(RM) $(man1) $(man5) $(man7)
+        $(RM) $(addsuffix .txt.gz, $(m1) $(m5) $(m7))