propset - enables svn keywords
[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 vpath GenDoc.xsl ../../plc_www/doc
11 vpath %_config.xml ..
12
13 # dont redo php by default, this requires plc_www (see above) 
14 # that we build separately (has no doc/ subdir anyway)
15 # note that the build host (myplc-devel) needs ghostscript
16 # that we added only on 20 july 2007
17 all: myplc.pdf myplc.html
18
19 static: pyplc.php
20
21 .PHONY: all
22
23 # Dependencies
24 .myplc.xml.valid: architecture.eps architecture.png plc_variables.xml plc_devel_variables.xml
25
26 %_variables.xml: variables.xsl %_config.xml
27         xsltproc $(XSLFLAGS) --output $@ $^
28
29 # Validate the XML
30 .%.xml.valid: %.xml
31         xmllint --valid --output $@ $<
32
33 # Compile it into other formats
34 FORMATS := dvi html man ps rtf tex texi txt
35
36 DOCBOOK2FLAGS := -V biblio-number=1
37
38 define docbook2
39 %.$(1): %.xml .%.xml.valid
40         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
41 endef
42
43 # docbook2pdf craps out on figures
44 %.pdf: %.ps
45         ps2pdf $< $@
46
47 # PHP for the website
48 %.php: GenDoc.xsl .%.xml.valid
49         xsltproc $(XSLFLAGS) --output $@ $^
50
51 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
52
53 docclean:
54         rm -f $(patsubst %,*.%,$(FORMATS)) *.pdf *.php .*.xml.valid variables.xml 
55
56 clean: docclean
57
58 .PHONY: docclean