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