Updated Polish translation
[dasher.git] / gnome-doc-utils.make
blob363e4fb3565cf4dbb7d8e10e581ff1667ec774e2
1 # gnome-doc-utils.make - make magic for building documentation
2 # Copyright (C) 2004-2005 Shaun McCance <shaunm@gnome.org>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 # As a special exception to the GNU General Public License, if you
18 # distribute this file as part of a program that contains a
19 # configuration script generated by Autoconf, you may include it under
20 # the same distribution terms that you use for the rest of that program.
22 ################################################################################
23 ## @@ Generating Header Files
25 ## @ DOC_H_FILE
26 ## The name of the header file to generate
27 DOC_H_FILE ?=
29 ## @ DOC_H_DOCS
30 ## The input DocBook files for generating the header file
31 DOC_H_DOCS ?=
33 $(DOC_H_FILE): $(DOC_H_DOCS);
34 @rm -f $@.tmp; touch $@.tmp;
35 echo 'const gchar* documentation_credits[] = {' >> $@.tmp
36 list='$(DOC_H_DOCS)'; for doc in $$list; do \
37 xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
38 if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
39 xsltproc --path "$$xmlpath" $(_credits) $$doc; \
40 done | sort | uniq \
41 | awk 'BEGIN{s=""}{n=split($$0,w,"<");if(s!=""&&s!=substr(w[1],1,length(w[1])-1)){print s};if(n>1){print $$0;s=""}else{s=$$0}};END{if(s!=""){print s}}' \
42 | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp
43 echo ' NULL' >> $@.tmp
44 echo '};' >> $@.tmp
45 echo >> $@.tmp
46 list='$(DOC_H_DOCS)'; for doc in $$list; do \
47 xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
48 if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
49 docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
50 | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
51 echo $$xmlpath; \
52 ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
53 for id in $$ids; do \
54 echo '#define HELP_'`echo $$docid`'_'`echo $$id \
55 | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \
56 done; \
57 echo >> $@.tmp; \
58 done;
59 cp $@.tmp $@ && rm -f $@.tmp
61 dist-check-gdu:
62 if !HAVE_GNOME_DOC_UTILS
63 @echo "*** GNOME Doc Utils must be installed in order to make dist"
64 @false
65 endif
67 .PHONY: dist-doc-header
68 dist-doc-header: $(DOC_H_FILE)
69 @if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \
70 echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \
71 $(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)";
73 doc-dist-hook: dist-check-gdu $(if $(DOC_H_FILE),dist-doc-header)
75 .PHONY: clean-doc-header
76 _clean_doc_header = $(if $(DOC_H_FILE),clean-doc-header)
77 clean-local: $(_clean_doc_header)
78 distclean-local: $(_clean_doc_header)
79 mostlyclean-local: $(_clean_doc_header)
80 maintainer-clean-local: $(_clean_doc_header)
81 clean-doc-header:
82 rm -f $(DOC_H_FILE)
84 all: $(DOC_H_FILE)
87 ################################################################################
88 ## @@ Generating Documentation Files
90 ## @ DOC_MODULE
91 ## The name of the document being built
92 DOC_MODULE ?=
94 ## @ DOC_ENTITIES
95 ## Files included with a SYSTEM entity
96 DOC_ENTITIES ?=
98 ## @ DOC_INCLUDES
99 ## Files included with XInclude
100 DOC_INCLUDES ?=
102 ## @ DOC_FIGURES
103 ## Figures and other external data
104 DOC_FIGURES ?=
106 ## @ DOC_FORMATS
107 ## The default formats to be built and installed
108 DOC_FORMATS ?= docbook
109 _DOC_REAL_FORMATS = $(if $(DOC_USER_FORMATS),$(DOC_USER_FORMATS),$(DOC_FORMATS))
111 ## @ DOC_LINGUAS
112 ## The languages this document is translated into
113 DOC_LINGUAS ?=
114 _DOC_REAL_LINGUAS = $(if $(filter environment,$(origin LINGUAS)), \
115 $(filter $(LINGUAS),$(DOC_LINGUAS)), \
116 $(DOC_LINGUAS))
118 _DOC_ABS_SRCDIR = @abs_srcdir@
121 ################################################################################
122 ## Variables for Bootstrapping
124 _xml2po ?= `which xml2po`
126 _db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
127 _db2omf ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
128 _chunks ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
129 _credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
130 _ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
132 if ENABLE_SK
133 _ENABLE_SK = true
134 _skpkgdatadir ?= `scrollkeeper-config --pkgdatadir`
135 _sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
136 _skcontentslist ?= $(_skpkgdatadir)/Templates/C/scrollkeeper_cl.xml
137 endif
140 ################################################################################
141 ## @@ Rules for OMF Files
143 db2omf_args = \
144 --stringparam db2omf.basename $(DOC_MODULE) \
145 --stringparam db2omf.format $(3) \
146 --stringparam db2omf.dtd \
147 $(shell xmllint --format $(2) | grep -h PUBLIC | head -n 1 \
148 | sed -e 's/.*PUBLIC \(\"[^\"]*\"\).*/\1/') \
149 --stringparam db2omf.lang $(notdir $(patsubst %/$(notdir $(2)),%,$(2))) \
150 --stringparam db2omf.omf_dir "$(OMF_DIR)" \
151 --stringparam db2omf.help_dir "$(HELP_DIR)" \
152 --stringparam db2omf.omf_in "$(_DOC_OMF_IN)" \
153 $(if $(_ENABLE_SK), \
154 --stringparam db2omf.scrollkeeper_cl "$(_skcontentslist)") \
155 $(_db2omf) $(2)
157 ## @ _DOC_OMF_IN
158 ## The OMF input file
159 _DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(_DOC_ABS_SRCDIR)/$(DOC_MODULE).omf.in))
161 ## @ _DOC_OMF_DB
162 ## The OMF files for DocBook output
163 _DOC_OMF_DB = $(if $(_DOC_OMF_IN), \
164 $(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-$(lc).omf))
166 $(_DOC_OMF_DB) : $(_DOC_OMF_IN)
167 $(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %/$(DOC_MODULE).xml
168 @test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \
169 echo "The file '$(_skcontentslist)' does not exist." >&2; \
170 echo "Please check your ScrollKeeper installation." >&2; \
171 exit 1; }
172 xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
174 ## @ _DOC_OMF_HTML
175 ## The OMF files for HTML output
176 _DOC_OMF_HTML = $(if $(_DOC_OMF_IN), \
177 $(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-html-$(lc).omf))
179 $(_DOC_OMF_HTML) : $(_DOC_OMF_IN)
180 $(_DOC_OMF_HTML) : $(DOC_MODULE)-html-%.omf : %/$(DOC_MODULE).xml
181 if ENABLE_SK
182 @test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \
183 echo "The file '$(_skcontentslist)' does not exist" >&2; \
184 echo "Please check your ScrollKeeper installation." >&2; \
185 exit 1; }
186 endif
187 xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
189 ## @ _DOC_OMF_ALL
190 ## All OMF output files to be built
191 # FIXME
192 _DOC_OMF_ALL = \
193 $(if $(filter docbook,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_DB)) \
194 $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_HTML))
196 .PHONY: omf
197 omf: $(_DOC_OMF_ALL)
200 ################################################################################
201 ## @@ C Locale Documents
203 ## @ _DOC_C_MODULE
204 ## The top-level documentation file in the C locale
205 _DOC_C_MODULE = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml)
207 ## @ _DOC_C_ENTITIES
208 ## Files included with a SYSTEM entity in the C locale
209 _DOC_C_ENTITIES = $(foreach ent,$(DOC_ENTITIES),C/$(ent))
211 ## @ _DOC_C_XINCLUDES
212 ## Files included with XInclude in the C locale
213 _DOC_C_INCLUDES = $(foreach inc,$(DOC_INCLUDES),C/$(inc))
215 ## @ _DOC_C_DOCS
216 ## All documentation files in the C locale
217 _DOC_C_DOCS = \
218 $(_DOC_C_ENTITIES) $(_DOC_C_INCLUDES) \
219 $(_DOC_C_MODULE)
221 ## @ _DOC_C_DOCS_NOENT
222 ## All documentation files in the C locale,
223 ## except files included with a SYSTEM entity
224 _DOC_C_DOCS_NOENT = \
225 $(_DOC_C_MODULE) $(_DOC_C_INCLUDES)
227 ## @ _DOC_C_FIGURES
228 ## All figures and other external data in the C locale
229 _DOC_C_FIGURES = $(if $(DOC_FIGURES), \
230 $(foreach fig,$(DOC_FIGURES),C/$(fig)), \
231 $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/C/figures/*.png)))
233 ## @ _DOC_C_HTML
234 ## All HTML documentation in the C locale
235 # FIXME: probably have to shell escape to determine the file names
236 _DOC_C_HTML = $(foreach f, \
237 $(shell xsltproc --xinclude \
238 --stringparam db.chunk.basename "$(DOC_MODULE)" \
239 $(_chunks) "C/$(DOC_MODULE).xml"), \
240 C/$(f).xhtml)
242 ###############################################################################
243 ## @@ Other Locale Documentation
245 ## @ _DOC_POFILES
246 ## The .po files used for translating the document
247 _DOC_POFILES = $(if $(DOC_MODULE), \
248 $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(lc).po))
250 .PHONY: po
251 po: $(_DOC_POFILES)
253 ## @ _DOC_LC_MODULES
254 ## The top-level documentation files in all other locales
255 _DOC_LC_MODULES = $(if $(DOC_MODULE), \
256 $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xml))
258 ## @ _DOC_LC_XINCLUDES
259 ## Files included with XInclude in all other locales
260 _DOC_LC_INCLUDES = \
261 $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach inc,$(_DOC_C_INCLUDES), \
262 $(lc)/$(notdir $(inc)) ))
264 ## @ _DOC_LC_HTML
265 ## All HTML documentation in all other locales
266 # FIXME: probably have to shell escape to determine the file names
267 _DOC_LC_HTML = \
268 $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_DOC_C_HTML), \
269 $(lc)/$(notdir $(doc)) ))
271 ## @ _DOC_LC_DOCS
272 ## All documentation files in all other locales
273 _DOC_LC_DOCS = \
274 $(_DOC_LC_MODULES) $(_DOC_LC_INCLUDES) \
275 $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML))
277 ## @ _DOC_LC_FIGURES
278 ## All figures and other external data in all other locales
279 _DOC_LC_FIGURES = $(foreach lc,$(_DOC_REAL_LINGUAS), \
280 $(patsubst C/%,$(lc)/%,$(_DOC_C_FIGURES)) )
282 _DOC_SRC_FIGURES = \
283 $(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(_DOC_REAL_LINGUAS), \
284 $(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) ))
286 $(_DOC_POFILES):
287 @if ! test -d $(dir $@); then \
288 echo "mkdir $(dir $@)"; \
289 mkdir "$(dir $@)"; \
291 @if test ! -f $@ -a -f $(srcdir)/$@; then \
292 echo "cp $(srcdir)/$@ $@"; \
293 cp "$(srcdir)/$@" "$@"; \
295 @docs=; \
296 list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \
297 docs="$$docs $(_DOC_ABS_SRCDIR)/$$doc"; \
298 done; \
299 if ! test -f $@; then \
300 echo "(cd $(dir $@) && \
301 $(_xml2po) -e $$docs > $(notdir $@).tmp && \
302 cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \
303 (cd $(dir $@) && \
304 $(_xml2po) -e $$docs > $(notdir $@).tmp && \
305 cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \
306 else \
307 echo "(cd $(dir $@) && \
308 $(_xml2po) -e -u $(notdir $@) $$docs)"; \
309 (cd $(dir $@) && \
310 $(_xml2po) -e -u $(notdir $@) $$docs); \
313 # FIXME: fix the dependancy
314 # FIXME: hook xml2po up
315 $(_DOC_LC_DOCS) : $(_DOC_POFILES)
316 $(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
317 if ! test -d $(dir $@); then mkdir $(dir $@); fi
318 if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \
319 (cd $(dir $@) && \
320 $(_xml2po) -e -p \
321 "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
322 "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
323 cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
325 ## @ _DOC_POT
326 ## A pot file
327 _DOC_POT = $(if $(DOC_MODULE),$(DOC_MODULE).pot)
328 .PHONY: pot
329 pot: $(_DOC_POT)
330 $(_DOC_POT): $(_DOC_C_DOCS_NOENT)
331 $(_xml2po) -e -o $@ $^
334 ################################################################################
335 ## @@ All Documentation
337 ## @ _DOC_HTML_ALL
338 ## All HTML documentation, only if it's built
339 _DOC_HTML_ALL = $(if $(filter html HTML,$(_DOC_REAL_FORMATS)), \
340 $(_DOC_C_HTML) $(_DOC_LC_HTML))
342 _DOC_HTML_TOPS = $(foreach lc,C $(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xhtml)
344 $(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
345 xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@)
348 ################################################################################
350 all: \
351 $(_DOC_C_DOCS) $(_DOC_LC_DOCS) \
352 $(_DOC_OMF_ALL) $(_DOC_DSK_ALL) \
353 $(_DOC_HTML_ALL) $(_DOC_POFILES)
356 .PHONY: clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
358 clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
359 clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
360 clean-doc-lc:
361 rm -f $(_DOC_LC_DOCS)
362 @list='$(_DOC_POFILES)'; for po in $$list; do \
363 if ! test "$$po" -ef "$(srcdir)/$$po"; then \
364 echo "rm -f $$po"; \
365 rm -f "$$po"; \
366 fi; \
367 done
368 @for lc in C $(_DOC_REAL_LINGUAS); do \
369 if test -f "$$lc/.xml2po.mo"; then \
370 echo "rm -f $$lc/.xml2po.mo"; \
371 rm -f "$$lc/.xml2po.mo"; \
372 fi; \
373 done
374 clean-doc-dir:
375 @for lc in C $(_DOC_REAL_LINGUAS); do \
376 for dir in `find $$lc -depth -type d`; do \
377 if ! test $$dir -ef $(srcdir)/$$dir; then \
378 echo "rmdir $$dir"; \
379 rmdir "$$dir"; \
380 fi; \
381 done; \
382 done
384 _clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
385 _clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
386 _clean_lc = $(if $(_DOC_REAL_LINGUAS),clean-doc-lc)
387 _clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
389 clean-local: \
390 $(_clean_omf) $(_clean_dsk) \
391 $(_clean_lc) $(_clean_dir)
392 distclean-local: \
393 $(_clean_omf) $(_clean_dsk) \
394 $(_clean_lc) $(_clean_dir)
395 mostlyclean-local: \
396 $(_clean_omf) $(_clean_dsk) \
397 $(_clean_lc) $(_clean_dir)
398 maintainer-clean-local: \
399 $(_clean_omf) $(_clean_dsk) \
400 $(_clean_lc) $(_clean_dir)
403 .PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
404 doc-dist-hook: \
405 $(if $(DOC_MODULE),dist-doc-docs) \
406 $(if $(_DOC_C_FIGURES),dist-doc-figs) \
407 $(if $(_DOC_OMF_IN),dist-doc-omf)
408 # $(if $(_DOC_DSK_IN),dist-doc-dsk)
410 dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
411 @for lc in C $(_DOC_REAL_LINGUAS); do \
412 echo " $(mkinstalldirs) $(distdir)/$$lc"; \
413 $(mkinstalldirs) "$(distdir)/$$lc"; \
414 done
415 @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \
416 for doc in $$list; do \
417 if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
418 docdir=`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
419 if ! test -d "$(distdir)/$$docdir"; then \
420 echo "$(mkinstalldirs) $(distdir)/$$docdir"; \
421 $(mkinstalldirs) "$(distdir)/$$docdir"; \
422 fi; \
423 echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \
424 $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \
425 done
427 dist-doc-figs: $(_DOC_SRC_FIGURES)
428 @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \
429 for fig in $$list; do \
430 if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
431 if test -f "$$d$$fig"; then \
432 figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
433 if ! test -d "$(distdir)/$$figdir"; then \
434 echo "$(mkinstalldirs) $(distdir)/$$figdir"; \
435 $(mkinstalldirs) "$(distdir)/$$figdir"; \
436 fi; \
437 echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \
438 $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \
439 fi; \
440 done;
442 dist-doc-omf:
443 @if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \
444 echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \
445 $(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))"
447 dist-doc-dsk:
448 @if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \
449 echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \
450 $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))"
453 .PHONY: check-doc-docs check-doc-omf
454 check: \
455 $(if $(DOC_MODULE),check-doc-docs) \
456 $(if $(_DOC_OMF_IN),check-doc-omf)
458 check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
459 @for lc in C $(_DOC_REAL_LINGUAS); do \
460 if test -f "$$lc"; \
461 then d=; \
462 xmlpath="$$lc"; \
463 else \
464 d="$(srcdir)/"; \
465 xmlpath="$$lc:$(srcdir)/$$lc"; \
466 fi; \
467 echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \
468 xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \
469 done
471 check-doc-omf: $(_DOC_OMF_ALL)
472 @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
473 echo "xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \
474 xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \
475 done
478 .PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk
479 install-data-local: \
480 $(if $(DOC_MODULE),install-doc-docs) \
481 $(if $(_DOC_HTML_ALL),install-doc-html) \
482 $(if $(_DOC_C_FIGURES),install-doc-figs) \
483 $(if $(_DOC_OMF_IN),install-doc-omf)
484 # $(if $(_DOC_DSK_IN),install-doc-dsk)
486 install-doc-docs:
487 @for lc in C $(_DOC_REAL_LINGUAS); do \
488 echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc"; \
489 $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc; \
490 done
491 @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
492 if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
493 docdir="$$lc/"`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
494 docdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$docdir"; \
495 if ! test -d "$$docdir"; then \
496 echo "$(mkinstalldirs) $$docdir"; \
497 $(mkinstalldirs) "$$docdir"; \
498 fi; \
499 echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
500 $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc; \
501 done
503 install-doc-figs:
504 @list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \
505 for lc in C $(_DOC_REAL_LINGUAS); do \
506 figsymlink=false; \
507 if test -f "$$lc/$$fig"; then \
508 figfile="$$lc/$$fig"; \
509 elif test -f "$(srcdir)/$$lc/$$fig"; then \
510 figfile="$(srcdir)/$$lc/$$fig"; \
511 else \
512 figsymlink=true; \
513 fi; \
514 figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
515 figdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$figdir"; \
516 if ! test -d "$$figdir"; then \
517 echo "$(mkinstalldirs) $$figdir"; \
518 $(mkinstalldirs) "$$figdir"; \
519 fi; \
520 figbase=`echo $$fig | sed -e 's/^.*\///'`; \
521 if $$figsymlink; then \
522 echo "cd $$figdir && $(LN_S) -f ../../C/$$fig $$figbase"; \
523 ( cd "$$figdir" && $(LN_S) -f "../../C/$$fig" "$$figbase" ); \
524 else \
525 echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \
526 $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \
527 fi; \
528 done; \
529 done
531 install-doc-html:
532 echo install-html
534 install-doc-omf:
535 $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)
536 @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
537 echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
538 $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf; \
539 done
540 @if test "x$(_ENABLE_SK)" = "xtrue"; then \
541 echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
542 scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
545 install-doc-dsk:
546 echo install-dsk
549 .PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk
550 uninstall-local: \
551 $(if $(DOC_MODULE),uninstall-doc-docs) \
552 $(if $(_DOC_HTML_ALL),uninstall-doc-html) \
553 $(if $(_DOC_C_FIGURES),uninstall-doc-figs) \
554 $(if $(_DOC_OMF_IN),uninstall-doc-omf)
555 # $(if $(_DOC_DSK_IN),uninstall-doc-dsk)
557 uninstall-doc-docs:
558 @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
559 echo " rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
560 rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
561 done
563 uninstall-doc-figs:
564 @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \
565 echo "rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
566 rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
567 done;
569 uninstall-doc-omf:
570 @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
571 if test "x$(_ENABLE_SK)" = "xtrue"; then \
572 echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
573 scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
574 fi; \
575 echo "rm -f $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
576 rm -f "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
577 done