Module: sip-router
Branch: 4.1
Commit: d21e7fafc8384058d52d18147c96ef1fdcbee53f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d21e7fa…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Mar 20 00:12:14 2014 +0100
lib/srdb1/schema: added docbook-xml target to Makefile
- generate docbook for dbschema in xml format
(cherry picked from commit 509570a29bbecd6839fcd858c17a20dc04383f23)
---
lib/srdb1/schema/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/lib/srdb1/schema/Makefile b/lib/srdb1/schema/Makefile
index b84ffb2..3bc39d2 100644
--- a/lib/srdb1/schema/Makefile
+++ b/lib/srdb1/schema/Makefile
@@ -195,6 +195,50 @@ db_sqlite:
db_sqlite_clean:
-@rm -f $(SCHEME)/db_sqlite/*
+.PHONY: docbook-xml
+docbook-xml:
+ for FILE in $(TABLES); do \
+ XML_CATALOG_FILES=$(CATALOG) $(XSLTPROC) $(XSLTPROC_FLAGS) \
+ --stringparam dir "$(ROOT)/doc/databases/kamailio" \
+ --stringparam prefix "$$FILE-" \
+ $(DOCBOOK_XSL) kamailio-"$$FILE".xml ; \
+ done
+ # link all documents to one file, to get nicer output
+ echo "<?xml version=\"1.0\"
encoding=\"ISO-8859-1\"?>" \
+ > "$(ROOT)/doc/databases/kamailio/tables.xml"
+ echo "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML
V4.4//EN\"" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ echo " \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"
[" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ #Include general documentation entities
+ echo " <!ENTITY % docentities SYSTEM
\"../../../docbook/entities.xml\">" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ echo " %docentities;" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ echo "]>" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ echo "<book
xmlns:xi=\"http://www.w3.org/2001/XInclude\">" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ # add bookinfo
+ cat "$(ROOT)/doc/stylesheets/dbschema_k/bookinfo.xml" | tail -n +2 \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ # actually include the entities
+ for FILE in $(wildcard $(ROOT)/doc/databases/kamailio/*-dbschema.xml); do \
+ echo " <xi:include href=\"$$FILE\" />" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml" ; \
+ done
+ echo "</book>" \
+ >> "$(ROOT)/doc/databases/kamailio/tables.xml"
+ # generate makefile
+ echo "docs = tables.xml" \
+ > "$(ROOT)/doc/databases/kamailio/Makefile"
+ echo \
+ >> "$(ROOT)/doc/databases/kamailio/Makefile"
+ echo "docbook_dir = ../../../docbook" \
+ >> "$(ROOT)/doc/databases/kamailio/Makefile"
+ echo "include \$$(docbook_dir)/Makefile" \
+ >> "$(ROOT)/doc/databases/kamailio/Makefile"
+
.PHONY: docbook docbook_clean
docbook:
for FILE in $(TABLES); do \