~ubuntu-branches/ubuntu/lucid/cheese/lucid

« back to all changes in this revision

Viewing changes to gnome-doc-utils.make

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-09-21 11:26:33 UTC
  • mfrom: (1.2.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090921112633-0e9pgl6fb6shjqo6
Tags: 2.28.0-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
## The name of the document being built
93
93
DOC_MODULE ?=
94
94
 
 
95
## @ DOC_ID
 
96
## The unique identifier for a Mallard document
 
97
DOC_ID ?=
 
98
 
 
99
## @ DOC_PAGES
 
100
## Page files in a Mallard document
 
101
DOC_PAGES ?=
 
102
 
95
103
## @ DOC_ENTITIES
96
104
## Files included with a SYSTEM entity
97
105
DOC_ENTITIES ?=
123
131
## Variables for Bootstrapping
124
132
 
125
133
_xml2po ?= `which xml2po`
 
134
_xml2po_mode = $(if $(DOC_ID),mallard,docbook)
126
135
 
127
136
_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
128
137
_db2omf  ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
 
138
_malrng  ?= `$(PKG_CONFIG) --variable malrng gnome-doc-utils`
129
139
_chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
130
140
_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
131
141
_ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
205
215
## The top-level documentation file in the C locale
206
216
_DOC_C_MODULE = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml)
207
217
 
 
218
## @ _DOC_C_PAGES
 
219
## Page files in a Mallard document in the C locale
 
220
_DOC_C_PAGES = $(foreach page,$(DOC_PAGES),C/$(page))
 
221
 
208
222
## @ _DOC_C_ENTITIES
209
223
## Files included with a SYSTEM entity in the C locale
210
224
_DOC_C_ENTITIES = $(foreach ent,$(DOC_ENTITIES),C/$(ent))
217
231
## All documentation files in the C locale
218
232
_DOC_C_DOCS =                                                           \
219
233
        $(_DOC_C_ENTITIES)      $(_DOC_C_INCLUDES)                      \
220
 
        $(_DOC_C_MODULE)
 
234
        $(_DOC_C_PAGES)         $(_DOC_C_MODULE)
221
235
 
222
236
## @ _DOC_C_DOCS_NOENT
223
237
## All documentation files in the C locale,
224
238
## except files included with a SYSTEM entity
225
239
_DOC_C_DOCS_NOENT =                                                     \
226
 
        $(_DOC_C_MODULE)        $(_DOC_C_INCLUDES)
 
240
        $(_DOC_C_MODULE)        $(_DOC_C_INCLUDES)                      \
 
241
        $(_DOC_C_PAGES)
227
242
 
228
243
## @ _DOC_C_FIGURES
229
244
## All figures and other external data in the C locale
245
260
 
246
261
## @ _DOC_POFILES
247
262
## The .po files used for translating the document
248
 
_DOC_POFILES = $(if $(DOC_MODULE),                                              \
 
263
_DOC_POFILES = $(if $(DOC_MODULE)$(DOC_ID),                                     \
249
264
        $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(lc).po))
250
265
 
251
266
.PHONY: po
256
271
_DOC_LC_MODULES = $(if $(DOC_MODULE),                                           \
257
272
        $(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xml))
258
273
 
 
274
## @ _DOC_LC_PAGES
 
275
## Page files in a Mallard document in all other locales
 
276
_DOC_LC_PAGES =                                                                 \
 
277
        $(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach page,$(_DOC_C_PAGES),       \
 
278
                $(lc)/$(notdir $(page)) ))
 
279
 
259
280
## @ _DOC_LC_XINCLUDES
260
281
## Files included with XInclude in all other locales
261
282
_DOC_LC_INCLUDES =                                                              \
272
293
## @ _DOC_LC_DOCS
273
294
## All documentation files in all other locales
274
295
_DOC_LC_DOCS =                                                                  \
275
 
        $(_DOC_LC_MODULES)      $(_DOC_LC_INCLUDES)                             \
 
296
        $(_DOC_LC_MODULES)      $(_DOC_LC_INCLUDES)     $(_DOC_LC_PAGES)        \
276
297
        $(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML))
277
298
 
278
299
## @ _DOC_LC_FIGURES
299
320
        done; \
300
321
        if ! test -f $@; then \
301
322
          echo "(cd $(dir $@) && \
302
 
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
323
            $(_xml2po) -m $(_xml2po_mode) -e $$docs > $(notdir $@).tmp && \
303
324
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \
304
325
          (cd $(dir $@) && \
305
 
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
326
            $(_xml2po) -m $(_xml2po_mode) -e $$docs > $(notdir $@).tmp && \
306
327
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \
307
328
        else \
308
329
          echo "(cd $(dir $@) && \
309
 
            $(_xml2po) -e -u $(notdir $@) $$docs)"; \
 
330
            $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs)"; \
310
331
          (cd $(dir $@) && \
311
 
            $(_xml2po) -e -u $(notdir $@) $$docs); \
 
332
            $(_xml2po) -m $(_xml2po_mode) -e -u $(notdir $@) $$docs); \
312
333
        fi
313
334
 
314
335
# FIXME: fix the dependancy
317
338
$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
318
339
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
319
340
        if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \
 
341
        po="$(dir $@)$(patsubst %/$(notdir $@),%,$@).po"; \
 
342
        if [ -f "$${po}" ]; then po="../$${po}"; else po="$(_DOC_ABS_SRCDIR)/$${po}"; fi; \
320
343
        (cd $(dir $@) && \
321
 
          $(_xml2po) -e -p \
322
 
            "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
 
344
          $(_xml2po) -m $(_xml2po_mode) -e -p "$${po}" \
323
345
            "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
324
346
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
325
347
 
329
351
.PHONY: pot
330
352
pot: $(_DOC_POT)
331
353
$(_DOC_POT): $(_DOC_C_DOCS_NOENT)
332
 
        $(_xml2po) -e -o $@ $^
 
354
        $(_xml2po) -m $(_xml2po_mode) -e -o $@ $^
333
355
 
334
356
 
335
357
################################################################################
347
369
 
348
370
 
349
371
################################################################################
 
372
## All
350
373
 
351
374
all:                                                    \
352
375
        $(_DOC_C_DOCS)          $(_DOC_LC_DOCS)         \
354
377
        $(_DOC_HTML_ALL)        $(_DOC_POFILES)
355
378
 
356
379
 
 
380
################################################################################
 
381
## Clean
 
382
 
357
383
.PHONY: clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
358
384
 
359
385
clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
385
411
_clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
386
412
_clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
387
413
_clean_lc  = $(if $(_DOC_REAL_LINGUAS),clean-doc-lc)
388
 
_clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
 
414
_clean_dir = $(if $(DOC_MODULE)$(DOC_ID),clean-doc-dir)
389
415
 
390
416
clean-local:                                            \
391
417
        $(_clean_omf)           $(_clean_dsk)           \
401
427
        $(_clean_lc)            $(_clean_dir)
402
428
 
403
429
 
404
 
.PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
405
 
doc-dist-hook:                                  \
406
 
        $(if $(DOC_MODULE),dist-doc-docs)       \
407
 
        $(if $(_DOC_C_FIGURES),dist-doc-figs)   \
 
430
 
 
431
################################################################################
 
432
## Dist
 
433
 
 
434
.PHONY: dist-doc-docs dist-doc-pages dist-doc-figs dist-doc-omf dist-doc-dsk
 
435
doc-dist-hook:                                          \
 
436
        $(if $(DOC_MODULE)$(DOC_ID),dist-doc-docs)      \
 
437
        $(if $(_DOC_C_FIGURES),dist-doc-figs)           \
408
438
        $(if $(_DOC_OMF_IN),dist-doc-omf)
409
439
#       $(if $(_DOC_DSK_IN),dist-doc-dsk)
410
440
 
451
481
        $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))"
452
482
 
453
483
 
 
484
 
 
485
################################################################################
 
486
## Check
 
487
 
454
488
.PHONY: check-doc-docs check-doc-omf
455
489
check:                                                  \
456
490
        $(if $(DOC_MODULE),check-doc-docs)              \
 
491
        $(if $(DOC_ID),check-doc-pages)                 \
457
492
        $(if $(_DOC_OMF_IN),check-doc-omf)
458
493
 
459
494
check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
469
504
          xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \
470
505
        done
471
506
 
 
507
check-doc-pages: $(_DOC_C_PAGES) $(_DOC_LC_PAGES)
 
508
        for lc in C $(_DOC_REAL_LINGUAS); do \
 
509
          if test -f "$$lc"; \
 
510
            then d=; \
 
511
            xmlpath="$$lc"; \
 
512
          else \
 
513
            d="$(srcdir)/"; \
 
514
            xmlpath="$$lc:$(srcdir)/$$lc"; \
 
515
          fi; \
 
516
          for page in $(DOC_PAGES); do \
 
517
            echo "xmllint --noout --noent --path $$xmlpath --xinclude --relaxng $(_malrng) $$d$$lc/$$page"; \
 
518
            xmllint --noout --noent --path "$$xmlpath" --xinclude --relaxng "$(_malrng)" "$$d$$lc/$$page"; \
 
519
          done; \
 
520
        done
 
521
 
472
522
check-doc-omf: $(_DOC_OMF_ALL)
473
523
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
474
524
          echo "xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \
476
526
        done
477
527
 
478
528
 
 
529
 
 
530
################################################################################
 
531
## Install
 
532
 
479
533
.PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk
 
534
 
 
535
_doc_install_dir = $(if $(DOC_ID),$(DOC_ID),$(DOC_MODULE))
 
536
 
480
537
install-data-local:                                     \
481
 
        $(if $(DOC_MODULE),install-doc-docs)            \
 
538
        $(if $(DOC_MODULE)$(DOC_ID),install-doc-docs)   \
482
539
        $(if $(_DOC_HTML_ALL),install-doc-html)         \
483
540
        $(if $(_DOC_C_FIGURES),install-doc-figs)        \
484
541
        $(if $(_DOC_OMF_IN),install-doc-omf)
486
543
 
487
544
install-doc-docs:
488
545
        @for lc in C $(_DOC_REAL_LINGUAS); do \
489
 
          echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc"; \
490
 
          $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc; \
 
546
          echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$lc"; \
 
547
          $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$lc; \
491
548
        done
492
549
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
493
550
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
494
551
          docdir="$$lc/"`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
495
 
          docdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$docdir"; \
 
552
          docdir="$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$docdir"; \
496
553
          if ! test -d "$$docdir"; then \
497
554
            echo "$(mkinstalldirs) $$docdir"; \
498
555
            $(mkinstalldirs) "$$docdir"; \
499
556
          fi; \
500
 
          echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
501
 
          $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc; \
 
557
          echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \
 
558
          $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc; \
502
559
        done
503
560
 
504
561
install-doc-figs:
513
570
              figsymlink=true; \
514
571
            fi; \
515
572
            figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
516
 
            figdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$figdir"; \
 
573
            figdir="$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$figdir"; \
517
574
            if ! test -d "$$figdir"; then \
518
575
              echo "$(mkinstalldirs) $$figdir"; \
519
576
              $(mkinstalldirs) "$$figdir"; \
533
590
        echo install-html
534
591
 
535
592
install-doc-omf:
536
 
        $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)
 
593
        $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)
537
594
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
538
 
          echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
539
 
          $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf; \
 
595
          echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \
 
596
          $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf; \
540
597
        done
541
598
        @if test "x$(_ENABLE_SK)" = "xtrue"; then \
542
 
          echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
543
 
          scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
599
          echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)"; \
 
600
          scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)"; \
544
601
        fi;
545
602
 
546
603
install-doc-dsk:
547
604
        echo install-dsk
548
605
 
549
606
 
 
607
 
 
608
################################################################################
 
609
## Uninstall
 
610
 
550
611
.PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk
551
612
uninstall-local:                                        \
552
 
        $(if $(DOC_MODULE),uninstall-doc-docs)          \
 
613
        $(if $(DOC_MODULE)$(DOC_ID),uninstall-doc-docs) \
553
614
        $(if $(_DOC_HTML_ALL),uninstall-doc-html)       \
554
615
        $(if $(_DOC_C_FIGURES),uninstall-doc-figs)      \
555
616
        $(if $(_DOC_OMF_IN),uninstall-doc-omf)
557
618
 
558
619
uninstall-doc-docs:
559
620
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
560
 
          echo " rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
561
 
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
 
621
          echo " rm -f $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \
 
622
          rm -f "$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$doc"; \
562
623
        done
563
624
 
564
625
uninstall-doc-figs:
565
626
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \
566
 
          echo "rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
567
 
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
 
627
          echo "rm -f $(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$fig"; \
 
628
          rm -f "$(DESTDIR)$(HELP_DIR)/$(_doc_install_dir)/$$fig"; \
568
629
        done;
569
630
 
570
631
uninstall-doc-omf:
571
632
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
572
633
          if test "x$(_ENABLE_SK)" = "xtrue"; then \
573
 
            echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
574
 
            scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
634
            echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \
 
635
            scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \
575
636
          fi; \
576
 
          echo "rm -f $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
577
 
          rm -f "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
637
          echo "rm -f $(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \
 
638
          rm -f "$(DESTDIR)$(OMF_DIR)/$(_doc_install_dir)/$$omf"; \
578
639
        done