Merge remote-tracking branch 'origin/pycurl' into planetlab-4_0-branch
[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: Makefile,v 1.2 2006/11/03 20:36:05 thierry Exp $
8 #
9
10 all: PLCAPI.pdf
11
12 .PLCAPI.xml.valid: Methods.xml
13
14 Methods.xml: DocBook.py ../PLC/__init__.py ../PLC/Methods/__init__.py
15         PYTHONPATH=.. python $< > $@
16
17 #
18 # Documentation
19 #
20
21 # Validate the XML
22 .%.xml.valid: %.xml
23         xmllint --valid --output $@ $<
24
25 # Remove the temporary output file after compilation
26 .SECONDARY: .%.xml.valid
27
28 # Compile it into other formats
29 FORMATS := dvi html man ps pdf rtf tex texi txt
30
31 DOCBOOK2FLAGS := -V biblio-number=1
32
33 define docbook2
34 %.$(1): %.xml .%.xml.valid
35         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
36 endef
37
38 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
39
40 clean:
41         rm -f $(patsubst %,*.%,$(FORMATS)) .*.xml.valid Methods.xml
42
43 force:
44
45 .PHONY: force clean docclean