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/GNUmakefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
new file mode 100644
index 0000000..8aea6ae
--- /dev/null
+++ b/Documentation/GNUmakefile
@@ -0,0 +1,30 @@
+all::
+
+PANDOC = pandoc
+PANDOC_OPTS = -f markdown --email-obfuscation=none --sanitize-html
+pandoc = $(PANDOC) $(PANDOC_OPTS)
+pandoc_html = $(pandoc) --toc -t html --no-wrap
+
+man1 := $(addsuffix .1,posix-mq.rb)
+html1 := $(addsuffix .html,$(man1))
+
+all:: html man
+
+html: $(html1)
+man: $(man1)
+
+install-html: html
+        mkdir -p ../doc/man1
+        install -m 644 $(html1) ../doc/man1
+
+install-man: man
+        mkdir -p ../man/man1
+        install -m 644 $(man1) ../man/man1
+
+%.1: %.1.txt
+        $(pandoc) -s -t man < $< > $@+ && mv $@+ $@
+%.1.html: %.1.txt
+        $(pandoc_html) < $< > $@+ && mv $@+ $@
+
+clean::
+        $(RM) $(man1) $(html1)