cfa763f32a28fcc31ee341532595e484df929b80
[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$
8 #
9
10 all: myplc.pdf myplc.html
11
12 .PHONY: all
13
14 # Dependencies
15 .myplc.xml.valid: architecture.eps architecture.png plc_variables.xml 
16
17 plc_variables.xml: variables.xsl ../default_config.xml
18         xsltproc $(XSLFLAGS) --output $@ $^
19
20 # Validate the XML
21 .%.xml.valid: %.xml
22         xmllint --valid --output $@ $<
23
24 # Compile it into other formats
25 FORMATS := dvi html man ps rtf tex texi txt
26
27 DOCBOOK2FLAGS := -V biblio-number=1
28
29 define docbook2
30 %.$(1): %.xml .%.xml.valid
31         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
32 endef
33
34 # docbook2pdf craps out on figures
35 %.pdf: %.ps
36         ps2pdf $< $@
37
38 # PHP for the website
39 %.php: GenDoc.xsl .%.xml.valid
40         xsltproc $(XSLFLAGS) --output $@ $^
41
42 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
43
44 docclean:
45         rm -f $(patsubst %,*.%,$(FORMATS)) *.pdf *.php .*.xml.valid variables.xml 
46
47 clean: docclean
48
49 .PHONY: docclean