X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=docs%2FMakefile;fp=docs%2FMakefile;h=f3e6b765065b8afee9389f06d35a6c9da9deee0b;hp=0000000000000000000000000000000000000000;hb=0bdd5dcacea3b065ae4d888956e37ce439fb1229;hpb=588ff7737562c853de2772f90d83237cd035adb2 diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..f3e6b76 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,62 @@ +# +# (Re)builds API documentation +# +# Mark Huang +# Copyright (C) 2006 The Trustees of Princeton University +# +# $Id: Makefile 5574 2007-10-25 20:33:17Z thierry $ +# + +all: Monitor.html + +# XML - as opposed to SGML - requires an identifier - see +# http://www.docbook.org/tdg/en/html/appb.html +# and, openjade opens http connections when using the official URL +# as an identifier; this is slow, and sometimes fails and breaks the build + +# locating locally installed docbook43 dtd - fedora-specific +remote-docbook-43 = http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd +local-docbook-43 = $(wildcard /usr/share/sgml/docbook/xml-dtd-4.3-*/docbookx.dtd) +docbook-43=$(if $(local-docbook-43),$(local-docbook-43),$(remote-docbook-43)) + +Monitor.xml: Monitor.xml.in + $(if $(local-docbook-43), \ + echo Using locally installed DTD $(local-docbook-43), \ + echo WARNING - could not locate local DTD - using remote $(remote-docbook-43)) + sed -e s:@DOCBOOK-43@:$(docbook-43): $< > $@ + +.Monitor.xml.valid: Methods.xml + +MONITOR_SOURCES = ../web/MonitorWeb/monitorweb/monitor_xmlrpc.py + +# path needs to mention PLCAPI/doc (for DocBook) and PLCAPI/ (for PLC.Parameter) +Methods.xml: DocBookLocal.py $(MONITOR_SOURCES) + PYTHONPATH=..:../../PLCAPI:../../PLCAPI/doc ./DocBookLocal.py > $@ + +# +# Documentation +# + +# Validate the XML +.%.xml.valid: %.xml + xmllint --valid --output $@ $< + +# Remove the temporary output file after compilation +.SECONDARY: .%.xml.valid + +# Compile it into other formats +FORMATS := dvi html man ps pdf rtf tex texi txt + +DOCBOOK2FLAGS := -V biblio-number=1 + +define docbook2 +%.$(1): %.xml .%.xml.valid + docbook2$(1) --nochunks $$(DOCBOOK2FLAGS) $$< +endef + +$(foreach format,$(FORMATS),$(eval $(call docbook2,$(format)))) + +clean: + rm -f $(patsubst %,*.%,$(FORMATS)) .*.xml.valid Methods.xml + +.PHONY: clean all