60
60
cp $@.tmp $@ && rm -f $@.tmp
63
if !HAVE_GNOME_DOC_UTILS
64
@echo "*** GNOME Doc Utils must be installed in order to make dist"
62
68
.PHONY: dist-doc-header
63
69
dist-doc-header: $(DOC_H_FILE)
64
70
@if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \
65
71
echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \
66
72
$(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)";
68
doc-dist-hook: $(if $(DOC_H_FILE),dist-doc-header)
74
doc-dist-hook: dist-check-gdu $(if $(DOC_H_FILE),dist-doc-header)
70
76
.PHONY: clean-doc-header
71
77
_clean_doc_header = $(if $(DOC_H_FILE),clean-doc-header)
127
127
_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
128
128
_db2omf ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
129
_rngdoc ?= `$(PKG_CONFIG) --variable rngdoc gnome-doc-utils`
130
_xsldoc ?= `$(PKG_CONFIG) --variable xsldoc gnome-doc-utils`
131
129
_chunks ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
132
130
_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
133
131
_ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
135
_skpkgdatadir ?= `scrollkeeper-config --pkgdatadir`
135
136
_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
138
################################################################################
139
## @@ Rules for rngdoc
142
--stringparam rngdoc.id \
143
$(shell echo $(basename $(notdir $(1))) | sed -e 's/[^A-Za-z0-9_-]/_/g')\
144
$(_rngdoc) $(filter %/$(basename $(notdir $(1))).rng,$(_RNGDOC_RNGS))
147
## The actual RNG files for which to generate documentation with rngdoc
148
_RNGDOC_RNGS = $(sort $(patsubst ./%, %, $(foreach dir,$(RNGDOC_DIRS), \
149
$(wildcard $(dir)/*.rng) $(wildcard $(srcdir)/$(dir)/*.rng))))
152
## The generated rngdoc documentation in the C locale
153
_RNGDOC_C_DOCS = $(foreach rng,$(_RNGDOC_RNGS), C/$(basename $(notdir $(rng))).xml)
155
# FIXME: Fix the dependancies
156
$(_RNGDOC_C_DOCS) : $(_RNGDOC_RNGS)
157
if ! test -d $(dir $@); then mkdir $(dir $@); fi;
158
xsltproc $(call rngdoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
159
cp $@.tmp $@ && rm -f $@.tmp
162
rngdoc: $(_RNGDOC_C_DOCS)
165
################################################################################
166
## @@ Rules for xsldoc
168
# FIXME: _XSLDOC_XSLS is getting dupes with relative/absolute in some
169
# cases. Right now, I'm just taking the first, but that's just a bad
170
# work-around. Fix the real problem.
172
--stringparam xsldoc.id \
173
$(shell echo $(basename $(notdir $(1))) | sed -e 's/[^A-Za-z0-9_-]/_/g')\
175
$(word 1,$(filter %/$(basename $(notdir $(1))).xsl,$(_XSLDOC_XSLS)))
178
## The actual XSLT files for which to generate documentation with xsldoc
179
_XSLDOC_XSLS = $(sort $(patsubst ./%, %, $(foreach dir,$(XSLDOC_DIRS), \
180
$(wildcard $(dir)/*.xsl) $(wildcard $(srcdir)/$(dir)/*.xsl))))
183
## The generated xsldoc documentation in the C locale
184
_XSLDOC_C_DOCS = $(foreach xsl,$(_XSLDOC_XSLS), C/$(basename $(notdir $(xsl))).xml)
186
# FIXME: Fix the dependancies
187
$(_XSLDOC_C_DOCS) : $(_XSLDOC_XSLS)
188
if ! test -d $(dir $@); then mkdir $(dir $@); fi;
189
xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
190
cp $@.tmp $@ && rm -f $@.tmp
193
xsldoc: $(_XSLDOC_C_DOCS)
137
_skcontentslist ?= $(_skpkgdatadir)/Templates/C/scrollkeeper_cl.xml
196
141
################################################################################
205
150
--stringparam db2omf.lang $(notdir $(patsubst %/$(notdir $(2)),%,$(2))) \
206
151
--stringparam db2omf.omf_dir "$(OMF_DIR)" \
207
152
--stringparam db2omf.help_dir "$(HELP_DIR)" \
208
--stringparam db2omf.omf_in "`pwd`/$(_DOC_OMF_IN)" \
153
--stringparam db2omf.omf_in "$(_DOC_OMF_IN)" \
154
$(if $(_ENABLE_SK), \
155
--stringparam db2omf.scrollkeeper_cl "$(_skcontentslist)") \
212
159
## The OMF input file
213
_DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(srcdir)/$(DOC_MODULE).omf.in))
160
_DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(_DOC_ABS_SRCDIR)/$(DOC_MODULE).omf.in))
216
163
## The OMF files for DocBook output
220
167
$(_DOC_OMF_DB) : $(_DOC_OMF_IN)
221
168
$(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %/$(DOC_MODULE).xml
222
xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook')
169
@test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \
170
echo "The file '$(_skcontentslist)' does not exist." >&2; \
171
echo "Please check your ScrollKeeper installation." >&2; \
173
xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
224
175
## @ _DOC_OMF_HTML
225
176
## The OMF files for HTML output
229
180
$(_DOC_OMF_HTML) : $(_DOC_OMF_IN)
230
181
$(_DOC_OMF_HTML) : $(DOC_MODULE)-html-%.omf : %/$(DOC_MODULE).xml
231
xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml')
183
@test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || { \
184
echo "The file '$(_skcontentslist)' does not exist" >&2; \
185
echo "Please check your ScrollKeeper installation." >&2; \
188
xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
233
190
## @ _DOC_OMF_ALL
234
191
## All OMF output files to be built
244
201
################################################################################
245
## @@ Rules for .cvsignore Files
248
## The .cvsignore file in the top directory
249
_CVSIGNORE_TOP = $(if $(DOC_MODULE), .cvsignore)
252
## The .cvsignore file in the C directory
253
_CVSIGNORE_C = $(if $(DOC_MODULE), C/.cvsignore)
256
## The .cvsignore files in other locale directories
257
_CVSIGNORE_LC = $(if $(DOC_MODULE),$(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/.cvsignore))
259
## @ _CVSIGNORE_TOP_FILES
260
## The list of files to be listed in the top-level .cvsignore file
261
_CVSIGNORE_TOP_FILES = $(_DOC_OMF_ALL) $(_DOC_DSK_ALL)
263
## @ _CVSIGNORE_C_FILES
264
## The list of files to be listed in the .cvsignore file in the C directory
265
_CVSIGNORE_C_FILES = $(_RNGDOC_C_DOCS) $(_XSLDOC_C_DOCS)
267
## @ _CVSIGNORE_C_FILES
268
## The list of files to be listed in the .cvsignore files in other
269
## locale directories
270
_CVSIGNORE_LC_FILES = $(_DOC_LC_DOCS)
272
$(_CVSIGNORE_TOP) : $(_CVSIGNORE_TOP_FILES)
273
if ! test -f $@; then touch $@; fi
275
list='$^'; for file in $$list; do \
276
echo $$file >> $@.tmp; \
278
cat $@.tmp | sort | uniq > $@
281
$(_CVSIGNORE_C) : $(_CVSIGNORE_C_FILES)
282
if ! test -f $@; then touch $@; fi
284
list='$^'; for file in $$list; do \
285
echo $$file | sed -e 's/.*\///' >> $@.tmp; \
287
cat $@.tmp | sort | uniq > $@
290
$(_CVSIGNORE_LC) : $(_CVSIGNORE_LC_FILES)
291
if ! test -f $@; then touch $@; fi
293
list='$(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*)'; \
294
for file in $$list; do \
295
echo $$file | sed -e 's/.*\///' >> $@.tmp; \
297
cat $@.tmp | sort | uniq > $@
301
cvsignore: $(_CVSIGNORE_TOP) $(_CVSIGNROE_C) $(_CVSIGNORE_LC)
304
################################################################################
305
202
## @@ C Locale Documents
307
204
## @ _DOC_C_MODULE
320
217
## All documentation files in the C locale
322
219
$(_DOC_C_ENTITIES) $(_DOC_C_INCLUDES) \
323
$(_RNGDOC_C_DOCS) $(_XSLDOC_C_DOCS) \
326
222
## @ _DOC_C_DOCS_NOENT
327
223
## All documentation files in the C locale,
328
224
## except files included with a SYSTEM entity
329
225
_DOC_C_DOCS_NOENT = \
330
$(_DOC_C_MODULE) $(_DOC_C_INCLUDES) \
331
$(_RNGDOC_C_DOCS) $(_XSLDOC_C_DOCS)
226
$(_DOC_C_MODULE) $(_DOC_C_INCLUDES)
333
228
## @ _DOC_C_FIGURES
334
229
## All figures and other external data in the C locale
367
262
$(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach inc,$(_DOC_C_INCLUDES), \
368
263
$(lc)/$(notdir $(inc)) ))
371
## The generated rngdoc documentation in all other locales
373
$(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_RNGDOC_C_DOCS), \
374
$(lc)/$(notdir $(doc)) ))
377
## The generated xsldoc documentation in all other locales
379
$(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_XSLDOC_C_DOCS), \
380
$(lc)/$(notdir $(doc)) ))
382
265
## @ _DOC_LC_HTML
383
266
## All HTML documentation in all other locales
384
267
# FIXME: probably have to shell escape to determine the file names
438
316
$(_DOC_LC_DOCS) : $(_DOC_POFILES)
439
317
$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
440
318
if ! test -d $(dir $@); then mkdir $(dir $@); fi
441
case "$(srcdir)" in /*) sd="$(srcdir)";; *) sd="../$(srcdir)";; esac; \
442
if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$$sd/"; fi; \
319
if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \
443
320
(cd $(dir $@) && \
444
321
$(_xml2po) -e -p \
445
322
"$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
472
349
################################################################################
481
352
$(_DOC_C_DOCS) $(_DOC_LC_DOCS) \
482
353
$(_DOC_OMF_ALL) $(_DOC_DSK_ALL) \
483
354
$(_DOC_HTML_ALL) $(_DOC_POFILES)
486
.PHONY: clean-doc-rngdoc clean-doc-xsldoc clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
357
.PHONY: clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
488
clean-doc-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
489
clean-doc-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
490
359
clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
491
360
clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
516
_clean_rngdoc = $(if $(RNGDOC_DIRS),clean-doc-rngdoc)
517
_clean_xsldoc = $(if $(XSLDOC_DIRS),clean-doc-xsldoc)
518
385
_clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
519
386
_clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
520
387
_clean_lc = $(if $(_DOC_REAL_LINGUAS),clean-doc-lc)
521
388
_clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
524
$(_clean_rngdoc) $(_clean_xsldoc) \
525
391
$(_clean_omf) $(_clean_dsk) \
526
392
$(_clean_lc) $(_clean_dir)
527
393
distclean-local: \
528
$(_clean_rngdoc) $(_clean_xsldoc) \
529
394
$(_clean_omf) $(_clean_dsk) \
530
395
$(_clean_lc) $(_clean_dir)
531
396
mostlyclean-local: \
532
$(_clean_rngdoc) $(_clean_xsldoc) \
533
397
$(_clean_omf) $(_clean_dsk) \
534
398
$(_clean_lc) $(_clean_dir)
535
399
maintainer-clean-local: \
536
$(_clean_rngdoc) $(_clean_xsldoc) \
537
400
$(_clean_omf) $(_clean_dsk) \
538
401
$(_clean_lc) $(_clean_dir)