fix3
[plcapi.git] / doc / Makefile
1 #
2 # (Re)builds API 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: PLCAPI.html
11
12 .PLCAPI.xml.valid: Methods.xml
13
14 API_SOURCES = ../PLC/__init__.py ../PLC/Methods/__init__.py
15
16 Methods.xml: DocBook.py DocBookLocal.py $(API_SOURCES)
17         PYTHONPATH=.. ./DocBookLocal.py > $@
18
19 #
20 # Documentation
21 #
22
23 # Validate the XML
24 .%.xml.valid: %.xml
25         xmllint --valid --output $@ $<
26
27 # Remove the temporary output file after compilation
28 .SECONDARY: .%.xml.valid
29
30 # Compile it into other formats
31 FORMATS := dvi html man ps pdf rtf tex texi txt
32
33 DOCBOOK2FLAGS := -V biblio-number=1
34
35 define docbook2
36 %.$(1): %.xml .%.xml.valid
37         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
38 endef
39
40 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
41
42 clean:
43         rm -f $(patsubst %,*.%,$(FORMATS)) .*.xml.valid Methods.xml
44
45 .PHONY: clean all