summaryrefslogtreecommitdiffstats
path: root/Documentation/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Documentation/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644
index 0000000..8e0281c
--- /dev/null
+++ b/Documentation/Makefile
@@ -0,0 +1,31 @@
+PKGNAME = nvmetcli
+MANPAGE = ${PKGNAME}.8
+HTMLFILE = ${PKGNAME}.html
+XMLFILE = ${PKGNAME}.xml
+INSTALL ?= install
+PREFIX := /usr
+
+ASCIIDOC = asciidoc
+XMLTO = xmlto --skip-validation
+
+DOCDATA = ${XMLFILE} ${HTMLFILE}
+
+${MANPAGE}: ${DOCDATA}
+ ${XMLTO} man $<
+
+%.xml: %.txt
+ ${ASCIIDOC} -b docbook -d manpage -o $@ $<
+
+%.html: %.txt
+ ${ASCIIDOC} -a toc -o $@ $<
+
+installdoc: man8
+
+man8:
+ ${INSTALL} -m 644 ${MANPAGE} ${PREFIX}/share/man/man8
+
+uninstalldoc:
+ -rm -f ${PREFIX}/share/man/man8/${MANPAGE}
+
+clean:
+ -rm -f ${MANPAGE} ${HTMLFILE} ${XMLFILE}