first draft for the myplc-docs package (cross-module change)
[nodemanager.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 5574 2007-10-25 20:33:17Z thierry $
8 #
9
10 all: NMAPI.html
11
12 .NMAPI.xml.valid: Methods.xml
13
14 NM_SOURCES = ../api_calls.py
15
16 # path needs to mention PLCAPI/doc (for DocBook) and PLCAPI/ (for PLC.Parameter)
17 Methods.xml: DocBookLocal.py $(NM_SOURCES)
18         PYTHONPATH=..:../../PLCAPI:../../PLCAPI/doc DocBookLocal.py > $@
19
20 #
21 # Documentation
22 #
23
24 # Validate the XML
25 .%.xml.valid: %.xml
26         xmllint --valid --output $@ $<
27
28 # Remove the temporary output file after compilation
29 .SECONDARY: .%.xml.valid
30
31 # Compile it into other formats
32 FORMATS := dvi html man ps pdf rtf tex texi txt
33
34 DOCBOOK2FLAGS := -V biblio-number=1
35
36 define docbook2
37 %.$(1): %.xml .%.xml.valid
38         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
39 endef
40
41 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
42
43 clean:
44         rm -f $(patsubst %,*.%,$(FORMATS)) .*.xml.valid Methods.xml
45
46 .PHONY: clean all