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