NMAPI.xml now includes a section including and example using the nm-controller
[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,v 1.2 2006/11/03 20:36:05 thierry Exp $
8 #
9
10 all: NMAPI.html end
11
12 .NMAPI.xml.valid: Methods.xml
13
14 Methods.xml: DocBook.py ../api_calls.py
15         PYTHONPATH=..:../../../PLCAPI python $< > $@
16
17 #
18 # Documentation
19 #
20
21 # TODO: figure out where to put this command to strip out the unnecessary bits for PlanetLab Drupal page:
22 end:
23         awk 'BEGIN { print "</DIV" } {n++; if ( n > 29 && $$0 != "></BODY" && $$0 != "></HTML" ) { print $$0 } }' NMAPI.html > out.html
24
25 # Validate the XML
26 .%.xml.valid: %.xml
27         xmllint --valid --output $@ $<
28
29 # Remove the temporary output file after compilation
30 .SECONDARY: .%.xml.valid
31
32 # Compile it into other formats
33 FORMATS := dvi html man ps pdf rtf tex texi txt
34
35 DOCBOOK2FLAGS := -V biblio-number=1
36
37 define docbook2
38 %.$(1): %.xml .%.xml.valid
39         docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
40 endef
41
42 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
43
44 clean:
45         rm -f $(patsubst %,*.%,$(FORMATS)) .*.xml.valid Methods.xml
46
47 force:
48
49 .PHONY: force clean docclean