about summary refs log tree commit homepage
path: root/Documentation/GNUmakefile
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-01-02 02:33:23 -0800
committerEric Wong <normalperson@yhbt.net>2010-01-02 03:01:36 -0800
commit522d4d1472c216bd95a16ca5b118bc14693aad64 (patch)
treef8fd62c3dd562117edc71e2488542532e9db4cd5 /Documentation/GNUmakefile
downloadruby_posix_mq-522d4d1472c216bd95a16ca5b118bc14693aad64.tar.gz
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)