~ubuntu-branches/ubuntu/hardy/gcalctool/hardy-proposed

« back to all changes in this revision

Viewing changes to gnome-doc-utils.make

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-14 10:26:45 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20070514102645-8q5fjlr1ai7t4pb9
Tags: 5.19.2-0ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/control.in: 
    - Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>.
    - add liblaunchpad-integration-dev, intltool as Build-Depends.
    - add gcalctool-gtk package.
  - debian/rules: gcalctool-gtk package.
  - debian/patches/01_lpi.patch, debian/patches/02_autoconf.patch: LPI.
* New Upstream release.
* debian/patches/02_autoconf.patch: updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        done;
60
60
        cp $@.tmp $@ && rm -f $@.tmp
61
61
 
 
62
dist-check-gdu:
 
63
if !HAVE_GNOME_DOC_UTILS
 
64
        @echo "*** GNOME Doc Utils must be installed in order to make dist"
 
65
        @false
 
66
endif
 
67
 
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)";
67
73
 
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)
69
75
 
70
76
.PHONY: clean-doc-header
71
77
_clean_doc_header = $(if $(DOC_H_FILE),clean-doc-header)
110
116
        $(filter $(LINGUAS),$(DOC_LINGUAS)),                                    \
111
117
        $(DOC_LINGUAS))
112
118
 
113
 
## @ RNGDOC_DIRS
114
 
## The directories containing RNG files to be documented with rngdoc
115
 
RNGDOC_DIRS ?=
116
 
 
117
 
## @ XSLDOC_DIRS
118
 
## The directories containing XSLT files to be documented with xsldoc
119
 
XSLDOC_DIRS ?=
 
119
_DOC_ABS_SRCDIR = @abs_srcdir@
120
120
 
121
121
 
122
122
################################################################################
126
126
 
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
134
132
 
 
133
if ENABLE_SK
 
134
_ENABLE_SK = true
 
135
_skpkgdatadir ?= `scrollkeeper-config --pkgdatadir`
135
136
_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
136
 
 
137
 
 
138
 
################################################################################
139
 
## @@ Rules for rngdoc
140
 
 
141
 
rngdoc_args =                                                                   \
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))
145
 
 
146
 
## @ _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))))
150
 
 
151
 
## @ _RNGDOC_C_DOCS
152
 
## The generated rngdoc documentation in the C locale
153
 
_RNGDOC_C_DOCS = $(foreach rng,$(_RNGDOC_RNGS), C/$(basename $(notdir $(rng))).xml)
154
 
 
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
160
 
 
161
 
.PHONY: rngdoc
162
 
rngdoc: $(_RNGDOC_C_DOCS)
163
 
 
164
 
 
165
 
################################################################################
166
 
## @@ Rules for xsldoc
167
 
 
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.
171
 
xsldoc_args =                                                                   \
172
 
        --stringparam xsldoc.id                                                 \
173
 
        $(shell echo $(basename $(notdir $(1))) | sed -e 's/[^A-Za-z0-9_-]/_/g')\
174
 
        $(_xsldoc)                                                              \
175
 
        $(word 1,$(filter %/$(basename $(notdir $(1))).xsl,$(_XSLDOC_XSLS)))
176
 
 
177
 
## @ _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))))
181
 
 
182
 
## @ _XSLDOC_C_DOCS
183
 
## The generated xsldoc documentation in the C locale
184
 
_XSLDOC_C_DOCS = $(foreach xsl,$(_XSLDOC_XSLS), C/$(basename $(notdir $(xsl))).xml)
185
 
 
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
191
 
 
192
 
.PHONY: xsldoc
193
 
xsldoc: $(_XSLDOC_C_DOCS)
 
137
_skcontentslist ?= $(_skpkgdatadir)/Templates/C/scrollkeeper_cl.xml
 
138
endif
194
139
 
195
140
 
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)")            \
209
156
        $(_db2omf) $(2)
210
157
 
211
158
## @ _DOC_OMF_IN
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))
214
161
 
215
162
## @ _DOC_OMF_DB
216
163
## The OMF files for DocBook output
219
166
 
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;              \
 
172
          exit 1; }
 
173
        xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
223
174
 
224
175
## @ _DOC_OMF_HTML
225
176
## The OMF files for HTML output
228
179
 
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')
 
182
if ENABLE_SK
 
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;              \
 
186
          exit 1; }
 
187
endif
 
188
        xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
232
189
 
233
190
## @ _DOC_OMF_ALL
234
191
## All OMF output files to be built
242
199
 
243
200
 
244
201
################################################################################
245
 
## @@ Rules for .cvsignore Files
246
 
 
247
 
## @ _CVSIGNORE_TOP
248
 
## The .cvsignore file in the top directory
249
 
_CVSIGNORE_TOP = $(if $(DOC_MODULE), .cvsignore)
250
 
 
251
 
## @ _CVSIGNORE_C
252
 
## The .cvsignore file in the C directory
253
 
_CVSIGNORE_C = $(if $(DOC_MODULE), C/.cvsignore)
254
 
 
255
 
## @ _CVSIGNORE_LC
256
 
## The .cvsignore files in other locale directories
257
 
_CVSIGNORE_LC = $(if $(DOC_MODULE),$(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/.cvsignore))
258
 
 
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)
262
 
 
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)
266
 
 
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)
271
 
 
272
 
$(_CVSIGNORE_TOP) : $(_CVSIGNORE_TOP_FILES)
273
 
        if ! test -f $@; then touch $@; fi
274
 
        cat $@ > $@.tmp
275
 
        list='$^'; for file in $$list; do \
276
 
          echo $$file >> $@.tmp; \
277
 
        done
278
 
        cat $@.tmp | sort | uniq > $@
279
 
        rm $@.tmp
280
 
 
281
 
$(_CVSIGNORE_C) : $(_CVSIGNORE_C_FILES)
282
 
        if ! test -f $@; then touch $@; fi
283
 
        cat $@ > $@.tmp
284
 
        list='$^'; for file in $$list; do \
285
 
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
286
 
        done
287
 
        cat $@.tmp | sort | uniq > $@
288
 
        rm $@.tmp
289
 
 
290
 
$(_CVSIGNORE_LC) : $(_CVSIGNORE_LC_FILES)
291
 
        if ! test -f $@; then touch $@; fi
292
 
        cat $@ > $@.tmp
293
 
        list='$(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*)'; \
294
 
        for file in $$list; do \
295
 
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
296
 
        done
297
 
        cat $@.tmp | sort | uniq > $@
298
 
        rm $@.tmp
299
 
 
300
 
.PHONY: cvsignore
301
 
cvsignore: $(_CVSIGNORE_TOP) $(_CVSIGNROE_C) $(_CVSIGNORE_LC)
302
 
 
303
 
 
304
 
################################################################################
305
202
## @@ C Locale Documents
306
203
 
307
204
## @ _DOC_C_MODULE
320
217
## All documentation files in the C locale
321
218
_DOC_C_DOCS =                                                           \
322
219
        $(_DOC_C_ENTITIES)      $(_DOC_C_INCLUDES)                      \
323
 
        $(_RNGDOC_C_DOCS)       $(_XSLDOC_C_DOCS)                       \
324
220
        $(_DOC_C_MODULE)
325
221
 
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)
332
227
 
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)) ))
369
264
 
370
 
## @ _RNGDOC_LC_DOCS
371
 
## The generated rngdoc documentation in all other locales
372
 
_RNGDOC_LC_DOCS =                                                               \
373
 
        $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_RNGDOC_C_DOCS),      \
374
 
                $(lc)/$(notdir $(doc)) ))
375
 
 
376
 
## @ _XSLDOC_LC_DOCS
377
 
## The generated xsldoc documentation in all other locales
378
 
_XSLDOC_LC_DOCS =                                                               \
379
 
        $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_XSLDOC_C_DOCS),      \
380
 
                $(lc)/$(notdir $(doc)) ))
381
 
 
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
390
273
## All documentation files in all other locales
391
274
_DOC_LC_DOCS =                                                                  \
392
275
        $(_DOC_LC_MODULES)      $(_DOC_LC_INCLUDES)                             \
393
 
        $(_RNGDOC_LC_DOCS)      $(_XSLDOC_LC_DOCS)                              \
394
276
        $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML))
395
277
 
396
278
## @ _DOC_LC_FIGURES
413
295
        fi;
414
296
        @docs=; \
415
297
        list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \
416
 
          if test -f $$doc; then \
417
 
            docs="$$docs ../$$doc"; \
418
 
          else \
419
 
            docs="$$docs ../$(srcdir)/$$doc"; \
420
 
          fi; \
 
298
          docs="$$docs $(_DOC_ABS_SRCDIR)/$$doc"; \
421
299
        done; \
422
300
        if ! test -f $@; then \
423
301
          echo "(cd $(dir $@) && \
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" \
471
348
 
472
349
################################################################################
473
350
 
474
 
if ENABLE_SK
475
 
_ENABLE_SK = true
476
 
else
477
 
_ENABLE_SK = false
478
 
endif
479
 
 
480
351
all:                                                    \
481
352
        $(_DOC_C_DOCS)          $(_DOC_LC_DOCS)         \
482
353
        $(_DOC_OMF_ALL)         $(_DOC_DSK_ALL)         \
483
354
        $(_DOC_HTML_ALL)        $(_DOC_POFILES)
484
355
 
485
356
 
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
487
358
 
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)
492
361
clean-doc-lc:
513
382
          done; \
514
383
        done
515
384
 
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)
522
389
 
523
390
clean-local:                                            \
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)
539
402