Build-Depends-Indep on asciidoc, docbook-xsl and xsltproc
[grml-autoconfig.git] / doc / Makefile
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644 (file)
index 0000000..40881c0
--- /dev/null
@@ -0,0 +1,24 @@
+%.html : %.txt ;
+       asciidoc -b xhtml11 $^
+
+%.gz : %.txt ;
+       asciidoc -d manpage -b docbook $^
+       #sed -i 's/<emphasis role="strong">/<emphasis role="bold">/g' `echo $^ |sed -e 's/.txt/.xml/'`
+       xsltproc -nonet /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl `echo $^ |sed -e 's/.txt/.xml/'` &>/dev/null
+       # ugly hack to avoid '.sp' at the end of a sentence or paragraph:
+       sed -i 's/\.sp//' `echo $^ | sed -e 's/.txt//'`
+       gzip -f --best `echo $^ |sed -e 's/.txt//'`
+
+MANPAGES = grml-autoconfig
+
+all: doc
+
+doc: doc_html
+# doc: doc_man doc_html
+doc_html: $(addsuffix .html, $(MANPAGES))
+doc_man: $(addsuffix .gz, $(MANPAGES))
+
+clean:
+       @for i in $(MANPAGES); do \
+               rm -f $$i.html $$i.xml $$i.gz $$i; done
+