aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-03-27 20:22:42 +0100
committerLoïc Hoguin <[email protected]>2015-03-27 20:22:42 +0100
commit4ae8967785f2a01a9eacf12a5ff0710f393ba053 (patch)
treeaeba330b7da89f2ba673f30a1b8c5d984c2be801 /Makefile
parentba9ff8f5728694c226e5c2d38ac82da8faa0a243 (diff)
downloadgun-4ae8967785f2a01a9eacf12a5ff0710f393ba053.tar.gz
gun-4ae8967785f2a01a9eacf12a5ff0710f393ba053.tar.bz2
gun-4ae8967785f2a01a9eacf12a5ff0710f393ba053.zip
Update manual
A number of @todo also remain in this document. The manual pages have been converted to Asciidoc and they can be installed system-wide using make install-docs. The asciidoc rules will be converted into an erlang.mk plugin in the near future.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 30 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index a30f455..8a806cc 100644
--- a/Makefile
+++ b/Makefile
@@ -21,10 +21,34 @@ include erlang.mk
# AsciiDoc.
-asciidoc:
- a2x -v -f pdf doc/src/guide/book.asciidoc && mv doc/src/guide/book.pdf doc/guide.pdf
- a2x -v -f chunked doc/src/guide/book.asciidoc && mv doc/src/guide/book.chunked/* doc/
- rmdir doc/src/guide/book.chunked
+.PHONY: asciidoc asciidoc-guide asciidoc-manual clean-asciidoc
+
+MAN_INSTALL_PATH ?= /usr/local/share/man
+MAN_SECTIONS ?= 3 7
-clean::
- $(gen_verbose) rm doc/guide.pdf doc/*.html doc/*.css
+asciidoc: clean-asciidoc asciidoc-guide asciidoc-manual
+
+asciidoc-guide:
+ a2x -v -f pdf doc/src/guide/book.asciidoc && mv doc/src/guide/book.pdf doc/guide.pdf
+ a2x -v -f chunked doc/src/guide/book.asciidoc && mv doc/src/guide/book.chunked/ doc/html/
+
+asciidoc-manual:
+ for f in doc/src/manual/*.asciidoc ; do \
+ a2x -v -f manpage $$f ; \
+ done
+ for s in $(MAN_SECTIONS); do \
+ mkdir -p doc/man$$s/ ; \
+ mv doc/src/manual/*.$$s doc/man$$s/ ; \
+ gzip doc/man$$s/*.$$s ; \
+ done
+
+clean:: clean-asciidoc
+
+clean-asciidoc:
+ $(gen_verbose) rm -rf doc/html/ doc/guide.pdf doc/man3/ doc/man7/
+
+install-docs:
+ for s in $(MAN_SECTIONS); do \
+ mkdir -p $(MAN_INSTALL_PATH)/man$$s/ ; \
+ install -g 0 -o 0 -m 0644 doc/man$$s/*.gz $(MAN_INSTALL_PATH)/man$$s/ ; \
+ done