Browse code

docbook: folder moved from root to doc

Daniel-Constantin Mierla authored on 07/12/2016 13:55:42
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,204 +0,0 @@
1
-# This variable contains a list of docbook sources separated by white space to
2
-# be processed by the docbook build system if the user did not specify any
3
-# document on the command line. Documents configure here are processed one
4
-# after another, each of them will be treated as a standalone documentation
5
-# file.
6
-docs ?= index.xml
7
-
8
-# Here you can specify the name of the file that will be used to generate a
9
-# module README file. You can override it in a module Makefile. This is
10
-# useful, for example, if you want to use a different docbook file to generate
11
-# README and a different docbook file to generate documentation in other
12
-# formats (HTML, TXT). If you omit this variable in your Makefile then the
13
-# first document specified in DOCS is used to generate module README file.
14
-readme_docs ?= $(docs)
15
-
16
-# This is the list of docbook files to be used to generate HTML
17
-# documentation. You can use this variable in your Makefile if you have
18
-# docbook documents that should be processed only when HTML documentation is
19
-# being generated (i.e. you want them to be ignored when plain-text
20
-# documentation is being generated). Multiple documents separated by white
21
-# space can be configured here and they will be processed one after
22
-# another. If you omit this variable then the documents specified in DOCS
23
-# variable will be converted to HTML when HTML documentation is being built.
24
-html_docs ?= $(docs)
25
-
26
-# This is the list of docbook files to be used to generate plain-text
27
-# documentation. You can use this variable in your Makefile if you have
28
-# docbook documents that should be processed only when plain-textdocumentation
29
-# is being generated (i.e. you want them to be ignored when HTML documentation
30
-# is being generated). Multiple documents separated by white space can be
31
-# configured here and they will be processed one after another. If you omit
32
-# this variable then the documents specified in DOCS variable will be
33
-# converted to plain-text when plain-text documentation is being built.
34
-txt_docs ?= $(docs)
35
-
36
-# Output directory where files produced by XSL stylesheets should be stored,
37
-# by default we output to the same directory, documents that are chunked may
38
-# choose to override this to write all chunks in a subdirectory instead.
39
-output_dir ?= .
40
-
41
-# Here you can configure the path to the directory which contains all
42
-# auxiliary files that are needed to convert docbook documentation to other
43
-# formats. You should not need to use this variable under normal
44
-# circumstances.
45
-docbook_dir ?= ../../../docbook
46
-COREPATH ?= $(docbook_dir)/..
47
-
48
-# This is the stylesheet used to generate a list of dependencies for a docbook
49
-# source file. The stylesheet walks through the document and prints all files
50
-# that are included in the document. The list of files is then written in a
51
-# standalone file by this Makefile and the file can be included by the
52
-# Makefile.
53
-dep_xsl ?= $(docbook_dir)/dep.xsl
54
-
55
-# This is the stylesheet that is used to produce a single HTML file for every
56
-# docbook document being processed. This stylesheet contains configuration for
57
-# docbook XSL scripts that only applies when the build system generates a
58
-# single HTML file.
59
-single_html_xsl ?= $(docbook_dir)/html.xsl
60
-
61
-# This stylesheet is used to produce chunked HTML documention, the output will
62
-# be a set of HTML files. This stylesheet contains configuration for docbook
63
-# XSL scripts that only applies when multiple-file HTML documentation is being
64
-# generated.
65
-chunked_html_xsl ?= $(chunked_html_xls)/html.chunked.xsl
66
-
67
-# This stylesheet is used to produce plain-text documentation. Internally this
68
-# stylesheet includes the docbook XSL stylesheet used to produce single-file
69
-# HTML documentation and the output is then converted by lynx to a plain-text
70
-# file.
71
-txt_xsl ?= $(docbook_dir)/txt.xsl
72
-
73
-# This stylesheet is used when the docbook build system generates a module
74
-# README. The process is similar to the process of generating plain-text file,
75
-# but we use a separate stylesheet here because the configuration of docbook
76
-# XSL stylesheets can be a bit different for READMEs (i.e. we do not want to
77
-# have list of examples in READMES, etc.)
78
-readme_xsl ?= $(docbook_dir)/readme.xsl
79
-
80
-# Use this configuration variable to enable or disable docbook document
81
-# validation before the build system converts the document into another
82
-# format.
83
-validate ?= 0
84
-
85
-# A list of CSS stylesheets separated by whitespace to be included in HTML
86
-# files.
87
-html_css ?= /css/sr-doc.css
88
-
89
-# This is the catalog file used by xsltproc to locate docbook schema files
90
-# needed to validate docbook documents and docbook XSL stylesheets needed
91
-# convert docbook documents to other formats. All docbook documents in the
92
-# sip-router projects refer to schema files using public
93
-# identifiers. Similarly customization stylesheets refer to docbook XSL
94
-# stylesheets using public URIs. The catalog file is then used to convert
95
-# public identifiers and public URIs to files on local filesystem. The default
96
-# version of the catalog file only refers to file /etc/xml/catalog, this is
97
-# the site-wide catalog file present in Debian and possibly other systems
98
-# too. This file is updated by the package manager whenever docbook schema
99
-# file or docbook xsl stylesheets are being installed.
100
-catalog  ?= $(docbook_dir)/catalog.xml
101
-
102
-# Use standard catalog from OS, set it to no to use the above path to a
103
-# custom catalog file.
104
-nocatalog ?= yes
105
-
106
-lynx     ?= lynx
107
-dia      ?= dia
108
-xsltproc ?= xsltproc
109
-xmllint  ?= xmllint
110
-
111
-lynx_flags     ?= -nolist
112
-dia_args       ?=
113
-xsltproc_flags ?=
114
-xmllint_flags  ?= --xinclude --postvalid --noout
115
-
116
-ifeq ($(validate), 0)
117
-	override xsltproc_flags := $(xsltproc_flags) --novalid
118
-endif
119
-
120
-ifeq ($(nocatalog),yes)
121
-XMLCATALOGX=
122
-else
123
-XMLCATALOGX=XML_CATALOG_FILES=$(catalog)
124
-endif
125
-
126
-all_deps = Makefile $(docbook_dir)/Makefile $(docbook_dir)/entities.xml \
127
-		   $(dep_xsl) $(catalog) $(extra_deps)
128
-
129
-all: txt
130
-
131
-html_files = $(addprefix $(output_dir)/, $(addsuffix .html,\
132
-			 $(basename $(html_docs))))
133
-html_deps = $(addsuffix .d, $(basename $(html_docs)))
134
-
135
-txt_files = $(addprefix $(output_dir)/, $(addsuffix .txt,\
136
-			$(basename $(txt_docs))))
137
-txt_deps = $(addsuffix .d, $(basename $(txt_docs)))
138
-
139
-readme_deps = $(addsuffix .d, $(basename $(readme_docs)))
140
-
141
-html xhtml single_html single_xhtml: $(html_files)
142
-txt text plaintext: $(txt_files)
143
-readme README: ../README
144
-
145
-../README: $(readme_docs) $(readme_deps) $(readme_xsl) $(all_deps)
146
-	$(XMLCATALOGX) $(xsltproc) $(xsltproc_flags) \
147
-		--xinclude \
148
-        $(readme_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
149
-
150
-$(output_dir)/%.html: %.xml %.d $(single_html_xsl) $(all_deps)
151
-	$(XMLCATALOGX) $(xsltproc) $(xsltproc_flags) \
152
-        --xinclude \
153
-        --stringparam base.dir "$(output_dir)/" \
154
-        --stringparam root.filename "$(basename $<)" \
155
-        --stringparam html.stylesheet "$(html_css)" \
156
-        --stringparam html.ext ".html" \
157
-        $(single_html_xsl) $<
158
-
159
-
160
-$(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_deps)
161
-	$(XMLCATALOGX) $(xsltproc) $(xsltproc_flags) \
162
-		--xinclude \
163
-        $(txt_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
164
-
165
-%.png: %.dia $(all_dep)
166
-	$(dia) $(dia_flags) -t png -e $@ $<
167
-
168
-%.d: %.xml $(all_dep) 
169
-	$(xsltproc) $(xsltproc_flags) \
170
-        --nonet \
171
-        --novalid \
172
-        --stringparam output "$@" \
173
-        $(dep_xsl) $< 
174
-
175
-.PHONY: check
176
-check: $(docs) $(html_docs) $(txt_docs) $(readme_docs)
177
-	$(XMLCATALOGX) $(xmllint) $(xmllint_flags) $<
178
-
179
-.PHONY: clean
180
-clean:
181
-	-@rm -f $(html_files) $(txt_files)
182
-
183
-
184
-.PHONY: proper realclean distclean maintainer-clean
185
-proper realclean distclean maintainer-clean: clean
186
-	-rm -f $(html_deps) $(txt_deps) $(readme_deps) *~
187
-
188
-maintainer-clean: clean-tmp
189
-
190
-.PHONY: clean-tmp
191
-clean-tmp:
192
-	-rm -f TAGS tags *.dbg .*.swp
193
-
194
-
195
-ifeq (,$(MAKECMDGOALS))
196
-include $(html_deps) $(txt_deps) $(readme_deps)
197
-else
198
-ifeq (,$(strip $(nodep_targets)))
199
-include $(COREPATH)/Makefile.targets
200
-endif
201
-ifneq (,$(filter-out $(nodep_targets) check, $(MAKECMDGOALS)))
202
-include $(html_deps) $(txt_deps) $(readme_deps)
203
-endif
204
-endif
Browse code

docbook/Makefile: use default system catalog implicitely

- custom catalog can be forced with nocatalog=no

Daniel-Constantin Mierla authored on 10/01/2015 10:38:00
Showing 1 changed files
... ...
@@ -99,6 +99,10 @@ html_css ?= /css/sr-doc.css
99 99
 # file or docbook xsl stylesheets are being installed.
100 100
 catalog  ?= $(docbook_dir)/catalog.xml
101 101
 
102
+# Use standard catalog from OS, set it to no to use the above path to a
103
+# custom catalog file.
104
+nocatalog ?= yes
105
+
102 106
 lynx     ?= lynx
103 107
 dia      ?= dia
104 108
 xsltproc ?= xsltproc
Browse code

docbook: remove double quotes around XML_CATALOG_FILES

Daniel-Constantin Mierla authored on 03/11/2011 21:10:52
Showing 1 changed files
... ...
@@ -116,7 +116,7 @@ endif
116 116
 ifeq ($(nocatalog),yes)
117 117
 XMLCATALOGX=
118 118
 else
119
-XMLCATALOGX="XML_CATALOG_FILES=$(catalog)"
119
+XMLCATALOGX=XML_CATALOG_FILES=$(catalog)
120 120
 endif
121 121
 
122 122
 all_deps = Makefile $(docbook_dir)/Makefile $(docbook_dir)/entities.xml \
Browse code

docbook/Makefile: option to not use local catalog

- if nocatalog=yes, the xsltproc is started without XML_CATALOG_FILES
and the default ones from system are used

Daniel-Constantin Mierla authored on 27/10/2011 02:21:24
Showing 1 changed files
... ...
@@ -113,6 +113,12 @@ ifeq ($(validate), 0)
113 113
 	override xsltproc_flags := $(xsltproc_flags) --novalid
114 114
 endif
115 115
 
116
+ifeq ($(nocatalog),yes)
117
+XMLCATALOGX=
118
+else
119
+XMLCATALOGX="XML_CATALOG_FILES=$(catalog)"
120
+endif
121
+
116 122
 all_deps = Makefile $(docbook_dir)/Makefile $(docbook_dir)/entities.xml \
117 123
 		   $(dep_xsl) $(catalog) $(extra_deps)
118 124
 
... ...
@@ -133,12 +139,12 @@ txt text plaintext: $(txt_files)
133 139
 readme README: ../README
134 140
 
135 141
 ../README: $(readme_docs) $(readme_deps) $(readme_xsl) $(all_deps)
136
-	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
142
+	$(XMLCATALOGX) $(xsltproc) $(xsltproc_flags) \
137 143
 		--xinclude \
138 144
         $(readme_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
139 145
 
140 146
 $(output_dir)/%.html: %.xml %.d $(single_html_xsl) $(all_deps)
141
-	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
147
+	$(XMLCATALOGX) $(xsltproc) $(xsltproc_flags) \
142 148
         --xinclude \
143 149
         --stringparam base.dir "$(output_dir)/" \
144 150
         --stringparam root.filename "$(basename $<)" \
... ...
@@ -148,7 +154,7 @@ $(output_dir)/%.html: %.xml %.d $(single_html_xsl) $(all_deps)
148 154
 
149 155
 
150 156
 $(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_deps)
151
-	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
157
+	$(XMLCATALOGX) $(xsltproc) $(xsltproc_flags) \
152 158
 		--xinclude \
153 159
         $(txt_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
154 160
 
... ...
@@ -164,7 +170,7 @@ $(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_deps)
164 170
 
165 171
 .PHONY: check
166 172
 check: $(docs) $(html_docs) $(txt_docs) $(readme_docs)
167
-	XML_CATALOG_FILES=$(catalog) $(xmllint) $(xmllint_flags) $<
173
+	$(XMLCATALOGX) $(xmllint) $(xmllint_flags) $<
168 174
 
169 175
 .PHONY: clean
170 176
 clean:
Browse code

docbook: allow setting catalog path from command line

Daniel-Constantin Mierla authored on 03/07/2011 13:21:22
Showing 1 changed files
... ...
@@ -97,7 +97,7 @@ html_css ?= /css/sr-doc.css
97 97
 # the site-wide catalog file present in Debian and possibly other systems
98 98
 # too. This file is updated by the package manager whenever docbook schema
99 99
 # file or docbook xsl stylesheets are being installed.
100
-catalog=$(docbook_dir)/catalog.xml
100
+catalog  ?= $(docbook_dir)/catalog.xml
101 101
 
102 102
 lynx     ?= lynx
103 103
 dia      ?= dia
Browse code

docs: cleanup in xml files

- useless revision history removed
- docs depend on entities.xml
- updated global entities
- fixed the links to users and devel mailing lists
- fixed the link to tracker

Daniel-Constantin Mierla authored on 18/06/2011 21:21:41
Showing 1 changed files
... ...
@@ -113,7 +113,8 @@ ifeq ($(validate), 0)
113 113
 	override xsltproc_flags := $(xsltproc_flags) --novalid
114 114
 endif
115 115
 
116
-all_deps = Makefile $(docbook_dir)/Makefile $(dep_xsl) $(catalog) $(extra_deps)
116
+all_deps = Makefile $(docbook_dir)/Makefile $(docbook_dir)/entities.xml \
117
+		   $(dep_xsl) $(catalog) $(extra_deps)
117 118
 
118 119
 all: txt
119 120
 
Browse code

makefile.doc: be silent when cleaning

Andrei Pelinescu-Onciul authored on 05/02/2010 20:20:27
Showing 1 changed files
... ...
@@ -167,7 +167,7 @@ check: $(docs) $(html_docs) $(txt_docs) $(readme_docs)
167 167
 
168 168
 .PHONY: clean
169 169
 clean:
170
-	-rm -f $(html_files) $(txt_files)
170
+	-@rm -f $(html_files) $(txt_files)
171 171
 
172 172
 
173 173
 .PHONY: proper realclean distclean maintainer-clean
Browse code

docbook: Fixed docbook dependency generator

Previous version of the XSL stylesheet that is used to generate dependencies
for docbook documents did not work properly with docbook files included from
other directories, it did not make dependencies relative to the top-level
file being processed, resulting in dependency files that cannot be satisfied.

This change fixes the stylesheet and makes all the depedendencies generated
by the stylesheet relative to the directory of the top-level docbook document
being processed.

In addition to that it fixes a small typo in the main docbook Makefile.

Jan Janak authored on 13/05/2009 20:11:18
Showing 1 changed files
... ...
@@ -146,7 +146,7 @@ $(output_dir)/%.html: %.xml %.d $(single_html_xsl) $(all_deps)
146 146
         $(single_html_xsl) $<
147 147
 
148 148
 
149
-$(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_dep)
149
+$(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_deps)
150 150
 	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
151 151
 		--xinclude \
152 152
         $(txt_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
Browse code

New Docbook processing system.

This is the new and improved version of the docbook build system that
was present in ser and kamailio. It consists of Makefiles, xslt
stylesheets, css stylesheets, and other auxiliary files that are needed
to convert documentation stored in docbook xml format to various output
formats. We currently support the following outputs: HTML, plain-text,
and module README. Other formats (man pages, chunked HTML and possibly
PDF) will be added later.

First of all, we are moving all files that are part of the docbook
processing system into one directory "docbook". Those files were
previously scaterred across multiple directories in the repository and
having them all at one place make the system less error-prone.

We have merged files containing SGML entity definitions from both
projects into a single file. The file is stored in docbook/entities.xml
and this is the file that should be included by all docbook documents
(we will need to update all such files in all modules).

The Kamailio CSS style sheet for module documentation is now becoming
the main CSS stylesheet for HTML documentation generated from docbook
sources. The new stylesheet is stored in docbook/sr-doc.css. The
contents of the file was slighlty updated to make sure that the styles
in the file match HTML elements in XHTML output. With the new system
the default output HTML flavor is XHTML.

The toplevel Makefile.doc is gone. It is being replaced by file
docbook/Makefile. The new makefile has been extensively polished and
improved. This also requires new Makefiles in modules. All the targets
and references that were used to generate the PDF output in SER are
gone, we were using proprietary FOP processor which is not generally
available. All configuration options that can be overriden from
module/doc Makefiles are extensively commented. The new Makefile can
save the output being generated into a directory specified on the
command line:
$ output_dir=/html make html
The default target of the Makefile is HTML. There is a new target that
can be used generate module README:
$ make readme

The file that should be included from module Makefiles is
docbook/Makefile.modules. At present the file only includes the main
Makefile, but in the future some of the targets that are particular
to module documentation will be moved to this file.

The XML catalog received a small facelift, too. By default the catalog
references /etc/xml/catalog. References to dbschema DTD and XSL files
(dbschema is the scripting system used to generate SQL files in SER)
are gone. They do not belong into this file.

All references to Drupal and drupal related xsl stylesheets are gone.
Those files were used to generate HTML files suitable for inclusion
into Drupal pages at iptel.org.

File doc/kam_module_faq.xml has also been removed, this file was empty,
it was probably added because it was included by far too many docbook
documents in modules. Since I wrote a script to do some compatibility
changes in module docbook files, I taught it to remove the reference
to the file from all docbook files and then deleted the file.

All files in directory "docbook" are briefly described in
docbook/README.

The new system adopted Kamailio costumizations of the docbook stylesheet
that is used to generate READMEs. There is a new stylesheet called
readme.xsl that contains all options that should only be applied when
READMEs are being generated.

The stylesheet that generates man pages from docbook has been moved
from doc/stylesheets to docbook/man.xsl. We do not have yet support for
man pages in the docbook Makefile, this feature will be added later.

New features:
* Automatic dependency calculation. We have a XSL stylesheet which
traverses the source docbook document and produces a list of files
included in the document. This list is then included in the main
Makefile to calculate dependencies. That means you can split your
document into multiple files and the system will always correctly
rebuild the file.

* Support for document inclusion with xi:include. All source docbook
files are processed with the support for xi:include enabled which
makes it possible to include other documents without the need to
use SGML entities to include external files.

* Improved top level make file, among other things the makefile is now
much more flexible, the module can specify different source document
for each type of produced output. The makefile can generate module
READMEs. The output directory is configurable, which is useful if you
need to build a collection of html pages to be uploaded to a server.

* Separate stylesheet to customize the format of module README files.

* Supported output formats:
README
XHTML (single file)
XHTML (multiple files)
Plain-text

* Normalized screens: There is no longer the need to pay attention to
the leading and trailing white space in data of <screen> (and similar)
elements. Stylesheet common.xsl contains a template that does that
automatically (this isn't really a new feature, is was present in
the original ser docbook processing system).

Jan Janak authored on 24/04/2009 00:13:45
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,193 @@
1
+# This variable contains a list of docbook sources separated by white space to
2
+# be processed by the docbook build system if the user did not specify any
3
+# document on the command line. Documents configure here are processed one
4
+# after another, each of them will be treated as a standalone documentation
5
+# file.
6
+docs ?= index.xml
7
+
8
+# Here you can specify the name of the file that will be used to generate a
9
+# module README file. You can override it in a module Makefile. This is
10
+# useful, for example, if you want to use a different docbook file to generate
11
+# README and a different docbook file to generate documentation in other
12
+# formats (HTML, TXT). If you omit this variable in your Makefile then the
13
+# first document specified in DOCS is used to generate module README file.
14
+readme_docs ?= $(docs)
15
+
16
+# This is the list of docbook files to be used to generate HTML
17
+# documentation. You can use this variable in your Makefile if you have
18
+# docbook documents that should be processed only when HTML documentation is
19
+# being generated (i.e. you want them to be ignored when plain-text
20
+# documentation is being generated). Multiple documents separated by white
21
+# space can be configured here and they will be processed one after
22
+# another. If you omit this variable then the documents specified in DOCS
23
+# variable will be converted to HTML when HTML documentation is being built.
24
+html_docs ?= $(docs)
25
+
26
+# This is the list of docbook files to be used to generate plain-text
27
+# documentation. You can use this variable in your Makefile if you have
28
+# docbook documents that should be processed only when plain-textdocumentation
29
+# is being generated (i.e. you want them to be ignored when HTML documentation
30
+# is being generated). Multiple documents separated by white space can be
31
+# configured here and they will be processed one after another. If you omit
32
+# this variable then the documents specified in DOCS variable will be
33
+# converted to plain-text when plain-text documentation is being built.
34
+txt_docs ?= $(docs)
35
+
36
+# Output directory where files produced by XSL stylesheets should be stored,
37
+# by default we output to the same directory, documents that are chunked may
38
+# choose to override this to write all chunks in a subdirectory instead.
39
+output_dir ?= .
40
+
41
+# Here you can configure the path to the directory which contains all
42
+# auxiliary files that are needed to convert docbook documentation to other
43
+# formats. You should not need to use this variable under normal
44
+# circumstances.
45
+docbook_dir ?= ../../../docbook
46
+COREPATH ?= $(docbook_dir)/..
47
+
48
+# This is the stylesheet used to generate a list of dependencies for a docbook
49
+# source file. The stylesheet walks through the document and prints all files
50
+# that are included in the document. The list of files is then written in a
51
+# standalone file by this Makefile and the file can be included by the
52
+# Makefile.
53
+dep_xsl ?= $(docbook_dir)/dep.xsl
54
+
55
+# This is the stylesheet that is used to produce a single HTML file for every
56
+# docbook document being processed. This stylesheet contains configuration for
57
+# docbook XSL scripts that only applies when the build system generates a
58
+# single HTML file.
59
+single_html_xsl ?= $(docbook_dir)/html.xsl
60
+
61
+# This stylesheet is used to produce chunked HTML documention, the output will
62
+# be a set of HTML files. This stylesheet contains configuration for docbook
63
+# XSL scripts that only applies when multiple-file HTML documentation is being
64
+# generated.
65
+chunked_html_xsl ?= $(chunked_html_xls)/html.chunked.xsl
66
+
67
+# This stylesheet is used to produce plain-text documentation. Internally this
68
+# stylesheet includes the docbook XSL stylesheet used to produce single-file
69
+# HTML documentation and the output is then converted by lynx to a plain-text
70
+# file.
71
+txt_xsl ?= $(docbook_dir)/txt.xsl
72
+
73
+# This stylesheet is used when the docbook build system generates a module
74
+# README. The process is similar to the process of generating plain-text file,
75
+# but we use a separate stylesheet here because the configuration of docbook
76
+# XSL stylesheets can be a bit different for READMEs (i.e. we do not want to
77
+# have list of examples in READMES, etc.)
78
+readme_xsl ?= $(docbook_dir)/readme.xsl
79
+
80
+# Use this configuration variable to enable or disable docbook document
81
+# validation before the build system converts the document into another
82
+# format.
83
+validate ?= 0
84
+
85
+# A list of CSS stylesheets separated by whitespace to be included in HTML
86
+# files.
87
+html_css ?= /css/sr-doc.css
88
+
89
+# This is the catalog file used by xsltproc to locate docbook schema files
90
+# needed to validate docbook documents and docbook XSL stylesheets needed
91
+# convert docbook documents to other formats. All docbook documents in the
92
+# sip-router projects refer to schema files using public
93
+# identifiers. Similarly customization stylesheets refer to docbook XSL
94
+# stylesheets using public URIs. The catalog file is then used to convert
95
+# public identifiers and public URIs to files on local filesystem. The default
96
+# version of the catalog file only refers to file /etc/xml/catalog, this is
97
+# the site-wide catalog file present in Debian and possibly other systems
98
+# too. This file is updated by the package manager whenever docbook schema
99
+# file or docbook xsl stylesheets are being installed.
100
+catalog=$(docbook_dir)/catalog.xml
101
+
102
+lynx     ?= lynx
103
+dia      ?= dia
104
+xsltproc ?= xsltproc
105
+xmllint  ?= xmllint
106
+
107
+lynx_flags     ?= -nolist
108
+dia_args       ?=
109
+xsltproc_flags ?=
110
+xmllint_flags  ?= --xinclude --postvalid --noout
111
+
112
+ifeq ($(validate), 0)
113
+	override xsltproc_flags := $(xsltproc_flags) --novalid
114
+endif
115
+
116
+all_deps = Makefile $(docbook_dir)/Makefile $(dep_xsl) $(catalog) $(extra_deps)
117
+
118
+all: txt
119
+
120
+html_files = $(addprefix $(output_dir)/, $(addsuffix .html,\
121
+			 $(basename $(html_docs))))
122
+html_deps = $(addsuffix .d, $(basename $(html_docs)))
123
+
124
+txt_files = $(addprefix $(output_dir)/, $(addsuffix .txt,\
125
+			$(basename $(txt_docs))))
126
+txt_deps = $(addsuffix .d, $(basename $(txt_docs)))
127
+
128
+readme_deps = $(addsuffix .d, $(basename $(readme_docs)))
129
+
130
+html xhtml single_html single_xhtml: $(html_files)
131
+txt text plaintext: $(txt_files)
132
+readme README: ../README
133
+
134
+../README: $(readme_docs) $(readme_deps) $(readme_xsl) $(all_deps)
135
+	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
136
+		--xinclude \
137
+        $(readme_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
138
+
139
+$(output_dir)/%.html: %.xml %.d $(single_html_xsl) $(all_deps)
140
+	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
141
+        --xinclude \
142
+        --stringparam base.dir "$(output_dir)/" \
143
+        --stringparam root.filename "$(basename $<)" \
144
+        --stringparam html.stylesheet "$(html_css)" \
145
+        --stringparam html.ext ".html" \
146
+        $(single_html_xsl) $<
147
+
148
+
149
+$(output_dir)/%.txt: %.xml %.d $(txt_xsl) $(all_dep)
150
+	XML_CATALOG_FILES=$(catalog) $(xsltproc) $(xsltproc_flags) \
151
+		--xinclude \
152
+        $(txt_xsl) $< | $(lynx) $(lynx_flags) -stdin -dump > $@
153
+
154
+%.png: %.dia $(all_dep)
155
+	$(dia) $(dia_flags) -t png -e $@ $<
156
+
157
+%.d: %.xml $(all_dep) 
158
+	$(xsltproc) $(xsltproc_flags) \
159
+        --nonet \
160
+        --novalid \
161
+        --stringparam output "$@" \
162
+        $(dep_xsl) $< 
163
+
164
+.PHONY: check
165
+check: $(docs) $(html_docs) $(txt_docs) $(readme_docs)
166
+	XML_CATALOG_FILES=$(catalog) $(xmllint) $(xmllint_flags) $<
167
+
168
+.PHONY: clean
169
+clean:
170
+	-rm -f $(html_files) $(txt_files)
171
+
172
+
173
+.PHONY: proper realclean distclean maintainer-clean
174
+proper realclean distclean maintainer-clean: clean
175
+	-rm -f $(html_deps) $(txt_deps) $(readme_deps) *~
176
+
177
+maintainer-clean: clean-tmp
178
+
179
+.PHONY: clean-tmp
180
+clean-tmp:
181
+	-rm -f TAGS tags *.dbg .*.swp
182
+
183
+
184
+ifeq (,$(MAKECMDGOALS))
185
+include $(html_deps) $(txt_deps) $(readme_deps)
186
+else
187
+ifeq (,$(strip $(nodep_targets)))
188
+include $(COREPATH)/Makefile.targets
189
+endif
190
+ifneq (,$(filter-out $(nodep_targets) check, $(MAKECMDGOALS)))
191
+include $(html_deps) $(txt_deps) $(readme_deps)
192
+endif
193
+endif