2 # (Re)builds API documentation
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2006 The Trustees of Princeton University
7 # $Id: Makefile,v 1.2 2006/11/03 20:36:05 thierry Exp $
12 .NMAPI.xml.valid: Methods.xml
14 Methods.xml: DocBook.py ../api_calls.py
15 PYTHONPATH=..:../../../PLCAPI python $< > $@
21 # TODO: figure out where to put this command to strip out the unnecessary bits for PlanetLab Drupal page:
23 awk 'BEGIN { print "</DIV" } {n++; if ( n > 29 && $$0 != "></BODY" && $$0 != "></HTML" ) { print $$0 } }' NMAPI.html > out.html
27 xmllint --valid --output $@ $<
29 # Remove the temporary output file after compilation
30 .SECONDARY: .%.xml.valid
32 # Compile it into other formats
33 FORMATS := dvi html man ps pdf rtf tex texi txt
35 DOCBOOK2FLAGS := -V biblio-number=1
38 %.$(1): %.xml .%.xml.valid
39 docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$<
42 $(foreach format,$(FORMATS),$(eval $(call docbook2,$(format))))
45 rm -f $(patsubst %,*.%,$(FORMATS)) .*.xml.valid Methods.xml
49 .PHONY: force clean docclean