- MyPLC 0.4 RC2
[myplc.git] / doc / Makefile
1 #
2 # MyPLC documentation
3 #
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2006 The Trustees of Princeton University
6 #
7 # $Id: Makefile,v 1.5 2006/07/18 22:41:44 mlhuang Exp $
8 #
9
10 vpath GenDoc.xsl ../../plc_www/doc
11 vpath %_config.xml ..
12
13 all: myplc.pdf myplc.php
14
15 # Dependencies
16 .myplc.xml.valid: architecture.eps architecture.png plc_variables.xml plc_devel_variables.xml
17
18 %_variables.xml: variables.xsl %_config.xml
19         xsltproc $(XSLFLAGS) --output $@ $^
20
21 # Validate the XML
22 .%.xml.valid: %.xml
23         xmllint --valid --output $@ $<
24
25 # Compile it into other formats
26 FORMATS := dvi html man ps rtf tex texi txt
27
28 DOCBOOK2FLAGS := -V biblio-number=1
29
30 define docbook2
31 %.$(1): %.xml .%.xml.valid
32         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
33 endef
34
35 # docbook2pdf craps out on figures
36 %.pdf: %.ps
37         ps2pdf $< $@
38
39 # PHP for the website
40 %.php: GenDoc.xsl .%.xml.valid
41         xsltproc $(XSLFLAGS) --output $@ $^
42
43 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
44
45 docclean:
46         rm -f $(patsubst %,*.%,$(FORMATS)) *.pdf .*.xml.valid variables.xml
47
48 clean: docclean
49
50 .PHONY: docclean