- MyPLC User's Guide
[myplc.git] / doc / Makefile
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644 (file)
index 0000000..a756198
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# MyPLC documentation
+#
+# Mark Huang <mlhuang@cs.princeton.edu>
+# Copyright (C) 2006 The Trustees of Princeton University
+#
+# $Id: Makefile.in,v 1.6 2005/09/07 22:05:20 mlhuang Exp $
+#
+
+all: myplc.pdf
+
+# Validate the XML
+.%.xml.valid: %.xml
+       xmllint --valid --output $@ $<
+
+# Compile it into other formats
+FORMATS := dvi html man ps rtf tex texi txt
+
+DOCBOOK2FLAGS := -V biblio-number=1
+
+define docbook2
+%.$(1): %.xml .%.xml.valid
+       docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
+endef
+
+# docbook2pdf craps out on figures
+%.pdf: %.ps
+       ps2pdf $< $@
+
+$(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
+
+docclean:
+       rm -f $(patsubst %,*.%,$(FORMATS)) *.pdf .*.xml.valid
+
+clean: docclean
+
+.PHONY: docclean