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