~ubuntu-branches/ubuntu/lucid/gnome-doc-utils/lucid

« back to all changes in this revision

Viewing changes to doc/xslt/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-19 08:34:21 UTC
  • mto: (2.1.1 etch) (1.1.18 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051219083421-k72rkh3n6vox1c0t
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
@SET_MAKE@
16
16
 
 
17
# gnome-doc-utils.make - make magic for building documentation
 
18
# Copyright (C) 2004-2005 Shaun McCance <shaunm@gnome.org>
 
19
#
 
20
# This program is free software; you can redistribute it and/or modify
 
21
# it under the terms of the GNU General Public License as published by
 
22
# the Free Software Foundation; either version 2 of the License, or
 
23
# (at your option) any later version.
 
24
#
 
25
# This program is distributed in the hope that it will be useful,
 
26
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
27
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
28
# GNU General Public License for more details.
 
29
#
 
30
# You should have received a copy of the GNU General Public License
 
31
# along with this program; if not, write to the Free Software Foundation,
 
32
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
33
#
 
34
# As a special exception to the GNU General Public License, if you
 
35
# distribute this file as part of a program that contains a
 
36
# configuration script generated by Autoconf, you may include it under
 
37
# the same distribution terms that you use for the rest of that program.
 
38
 
17
39
################################################################################
18
40
SHELL = @SHELL@
19
41
 
140
162
        $(_rngdoc) $(filter %/$(basename $(notdir $(1))).rng,$(_RNGDOC_RNGS))
141
163
 
142
164
 
143
 
_RNGDOC_RNGS = $(foreach dir,$(RNGDOC_DIRS),                            \
144
 
        $(wildcard $(dir)/*.rng))
145
 
 
146
 
 
147
 
_RNGDOC_C_DOCS = $(foreach rng,$(_RNGDOC_RNGS),                         \
148
 
        C/$(basename $(notdir $(rng))).xml)
149
 
 
150
 
 
 
165
_RNGDOC_RNGS = $(sort $(patsubst ./%, %, $(foreach dir,$(RNGDOC_DIRS),          \
 
166
        $(wildcard $(dir)/*.rng) $(wildcard $(srcdir)/$(dir)/*.rng))))
 
167
 
 
168
 
 
169
_RNGDOC_C_DOCS = $(foreach rng,$(_RNGDOC_RNGS), C/$(basename $(notdir $(rng))).xml)
151
170
 
152
171
################################################################################
 
172
 
 
173
# FIXME: _XSLDOC_XSLS is getting dupes with relative/absolute in some
 
174
# cases.  Right now, I'm just taking the first, but that's just a bad
 
175
# work-around.  Fix the real problem.
153
176
xsldoc_args = \
154
177
        --stringparam xsldoc.id                                                 \
155
178
        $(shell echo $(basename $(notdir $(1))) | sed -e 's/[^A-Za-z0-9_-]/_/g')\
156
 
        $(_xsldoc) $(filter %/$(basename $(notdir $(1))).xsl,$(_XSLDOC_XSLS))
157
 
 
158
 
 
159
 
_XSLDOC_XSLS = $(foreach dir,$(XSLDOC_DIRS),                            \
160
 
        $(wildcard $(dir)/*.xsl))
161
 
 
162
 
 
163
 
_XSLDOC_C_DOCS = $(foreach xsl,$(_XSLDOC_XSLS),                         \
164
 
        C/$(basename $(notdir $(xsl))).xml)
165
 
 
 
179
        $(_xsldoc)                                                              \
 
180
        $(word 1,$(filter %/$(basename $(notdir $(1))).xsl,$(_XSLDOC_XSLS)))
 
181
 
 
182
 
 
183
_XSLDOC_XSLS = $(sort $(patsubst ./%, %, $(foreach dir,$(XSLDOC_DIRS),          \
 
184
        $(wildcard $(dir)/*.xsl) $(wildcard $(srcdir)/$(dir)/*.xsl))))
 
185
 
 
186
 
 
187
_XSLDOC_C_DOCS = $(foreach xsl,$(_XSLDOC_XSLS), C/$(basename $(notdir $(xsl))).xml)
166
188
 
167
189
 
168
190
################################################################################
172
194
        --stringparam db2omf.dtd                                                \
173
195
        $(shell xmllint --format $(2) | grep -h PUBLIC | head -n 1              \
174
196
                | sed -e 's/.*PUBLIC \(\"[^\"]*\"\).*/\1/')                     \
175
 
        --stringparam db2omf.lang $(patsubst %/$(notdir $(2)),%,$(2))           \
 
197
        --stringparam db2omf.lang $(notdir $(patsubst %/$(notdir $(2)),%,$(2))) \
176
198
        --stringparam db2omf.omf_dir "$(OMF_DIR)"                               \
177
199
        --stringparam db2omf.help_dir "$(HELP_DIR)"                             \
178
200
        --stringparam db2omf.omf_in "`pwd`/$(_DOC_OMF_IN)"                      \
294
316
        $(if $(findstring html,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML))
295
317
 
296
318
 
297
 
_DOC_LC_FIGURES = $(foreach lc,$(DOC_LINGUAS),                                  \
298
 
        $(if $(DOC_FIGURES),                                                    \
299
 
        $(foreach fig,$(DOC_FIGURES),$(lc)/$(fig)),                             \
300
 
        $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/$(lc)/figures/*.png)) ))
301
 
 
 
319
_DOC_LC_FIGURES = $(foreach lc,$(DOC_LINGUAS),                          \
 
320
        $(patsubst C/%,$(lc)/%,$(_DOC_C_FIGURES)) )
 
321
 
 
322
 
 
323
_DOC_SRC_FIGURES = \
 
324
        $(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(DOC_LINGUAS), \
 
325
                $(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) ))
 
326
 
 
327
 
 
328
_DOC_POT = $(if $(DOC_MODULE),$(DOC_MODULE).pot)
302
329
 
303
330
 
304
331
################################################################################
308
335
 
309
336
_DOC_HTML_TOPS = $(foreach lc,C $(DOC_LINGUAS),$(lc)/$(DOC_MODULE).html)
310
337
 
311
 
_clean_rngdoc = $(if $(RNGDOC_DIRS),clean-rngdoc)
312
 
_clean_xsldoc = $(if $(XSLDOC_DIRS),clean-xsldoc)
313
 
_clean_omf = $(if $(_DOC_OMF_IN),clean-omf)
314
 
_clean_dsk = $(if $(_DOC_DSK_IN),clean-dsk)
315
 
_clean_lc = $(if $(DOC_LINGUAS),clean-lc)
316
 
_xml2po = PYTHONPATH="$(shell pwd)/$(top_srcdir)/xml2po/modes" "$(shell pwd)/$(top_srcdir)/xml2po/xml2po"
 
338
 
 
339
################################################################################
 
340
@ENABLE_SK_TRUE@_ENABLE_SK = true
 
341
@ENABLE_SK_FALSE@_ENABLE_SK = false
 
342
 
 
343
_clean_rngdoc = $(if $(RNGDOC_DIRS),clean-doc-rngdoc)
 
344
_clean_xsldoc = $(if $(XSLDOC_DIRS),clean-doc-xsldoc)
 
345
_clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
 
346
_clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
 
347
_clean_lc = $(if $(DOC_LINGUAS),clean-doc-lc)
 
348
_clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
 
349
_xml2po = PYTHONPATH="$(shell pwd)/$(top_srcdir)/xml2po/modes:$(shell pwd)/$(top_builddir)/xml2po/modes" "$(shell pwd)/$(top_builddir)/xml2po/xml2po"
317
350
 
318
351
_db2html = $(top_srcdir)/xslt/docbook/html/db2html.xsl
319
352
_db2omf = $(top_srcdir)/xslt/docbook/omf/db2omf.xsl
330
363
DOC_LINGUAS = 
331
364
 
332
365
XSLDOC_DIRS = \
333
 
        $(top_srcdir)/xslt/gettext              \
334
 
        $(top_srcdir)/xslt/docbook/common       \
335
 
        $(top_srcdir)/xslt/docbook/html         \
336
 
        $(top_srcdir)/xslt/docbook/omf          \
337
 
        $(top_srcdir)/xslt/rngdoc               \
338
 
        $(top_srcdir)/xslt/xsldoc
 
366
        ../../xslt/gettext              \
 
367
        ../../xslt/docbook/common       \
 
368
        ../../xslt/docbook/html         \
 
369
        ../../xslt/docbook/omf          \
 
370
        ../../xslt/rngdoc               \
 
371
        ../../xslt/xsldoc
339
372
 
340
373
subdir = doc/xslt
341
374
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
415
448
        @echo "it deletes files that may require special tools to rebuild."
416
449
clean: clean-am
417
450
 
418
 
clean-am: clean-generic mostlyclean-am
 
451
clean-am: clean-generic clean-local mostlyclean-am
419
452
 
420
453
distclean: distclean-am
421
454
 
422
 
distclean-am: clean-am distclean-generic
 
455
distclean-am: clean-am distclean-generic distclean-local
423
456
 
424
457
dvi: dvi-am
425
458
 
441
474
 
442
475
maintainer-clean: maintainer-clean-am
443
476
 
444
 
maintainer-clean-am: distclean-am maintainer-clean-generic
 
477
maintainer-clean-am: distclean-am maintainer-clean-generic \
 
478
        maintainer-clean-local
445
479
 
446
480
mostlyclean: mostlyclean-am
447
481
 
448
 
mostlyclean-am: mostlyclean-generic
 
482
mostlyclean-am: mostlyclean-generic mostlyclean-local
449
483
 
450
484
uninstall-am: uninstall-info-am uninstall-local
451
485
 
452
 
.PHONY: all all-am check check-am clean clean-generic distclean \
453
 
        distclean-generic distdir dvi dvi-am info info-am install \
454
 
        install-am install-data install-data-am install-data-local \
455
 
        install-exec install-exec-am install-info install-info-am \
456
 
        install-man install-strip installcheck installcheck-am \
457
 
        installdirs maintainer-clean maintainer-clean-generic \
458
 
        mostlyclean mostlyclean-generic uninstall uninstall-am \
 
486
.PHONY: all all-am check check-am clean clean-generic clean-local \
 
487
        distclean distclean-generic distclean-local distdir dvi dvi-am \
 
488
        info info-am install install-am install-data install-data-am \
 
489
        install-data-local install-exec install-exec-am install-info \
 
490
        install-info-am install-man install-strip installcheck \
 
491
        installcheck-am installdirs maintainer-clean \
 
492
        maintainer-clean-generic maintainer-clean-local mostlyclean \
 
493
        mostlyclean-generic mostlyclean-local uninstall uninstall-am \
459
494
        uninstall-info-am uninstall-local
460
495
 
461
496
 
464
499
DOC_H_DOCS ?=
465
500
 
466
501
$(DOC_H_FILE): $(DOC_H_DOCS);
467
 
        @rm -f $@; touch $@;
468
 
        echo 'const gchar** documentation_credits = {' >> $@
469
 
        for doc in $(DOC_H_DOCS); do \
470
 
          xsltproc $(_credits) $$doc; \
 
502
        @rm -f $@.tmp; touch $@.tmp;
 
503
        echo 'const gchar* documentation_credits[] = {' >> $@.tmp
 
504
        list='$(DOC_H_DOCS)'; for doc in $$list; do \
 
505
          xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
 
506
          if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
 
507
          xsltproc --path "$$xmlpath" $(_credits) $$doc; \
471
508
        done | sort | uniq \
472
509
          | 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}}' \
473
 
          | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@
474
 
        echo '  NULL' >> $@
475
 
        echo '};' >> $@
476
 
        echo >> $@
477
 
        for doc in $(DOC_H_DOCS); do \
478
 
          docid=`echo $$doc  | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
 
510
          | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp
 
511
        echo '  NULL' >> $@.tmp
 
512
        echo '};' >> $@.tmp
 
513
        echo >> $@.tmp
 
514
        list='$(DOC_H_DOCS)'; for doc in $$list; do \
 
515
          xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
 
516
          if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
 
517
          docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
479
518
            | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
480
 
          ids=`xsltproc --xinclude $(_ids) $$doc`; \
 
519
          echo $$xmlpath; \
 
520
          ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
481
521
          for id in $$ids; do \
482
522
            echo '#define HELP_'`echo $$docid`'_'`echo $$id \
483
 
              | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@; \
 
523
              | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \
484
524
          done; \
485
 
          echo >> $@; \
 
525
          echo >> $@.tmp; \
486
526
        done;
 
527
        cp $@.tmp $@ && rm -f $@.tmp
487
528
 
488
 
.PHONY: dist-header
 
529
.PHONY: dist-doc-header
489
530
dist-doc-header: $(DOC_H_FILE)
490
 
        $(INSTALL_DATA) $(srcdir)/$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)
 
531
        @if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \
 
532
        echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \
 
533
        $(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)";
491
534
 
492
535
doc-dist-hook: $(if $(DOC_H_FILE),dist-doc-header)
493
536
 
494
 
.PHONY: chean-doc-header
495
 
clean: $(_clean_doc_header)
496
 
distclean: $(_clean_doc_header)
497
 
mostlyclean: $(_clean_doc_header)
498
 
maintainer-clean: $(_clean_doc_header)
 
537
.PHONY: clean-doc-header
 
538
clean-local: $(_clean_doc_header)
 
539
distclean-local: $(_clean_doc_header)
 
540
mostlyclean-local: $(_clean_doc_header)
 
541
maintainer-clean-local: $(_clean_doc_header)
499
542
clean-doc-header:
500
543
        rm -f $(DOC_H_FILE)
501
544
 
523
566
 
524
567
_xml2po ?= `which xml2po`
525
568
 
526
 
_db2html ?= `pkg-config --variable db2html gnome-doc-utils`
527
 
_db2omf  ?= `pkg-config --variable db2omf gnome-doc-utils`
528
 
_rngdoc  ?= `pkg-config --variable rngdoc gnome-doc-utils`
529
 
_xsldoc  ?= `pkg-config --variable xsldoc gnome-doc-utils`
530
 
_chunks  ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/chunks.xsl
531
 
_credits ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/credits.xsl
532
 
_ids ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/ids.xsl
 
569
_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
 
570
_db2omf  ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
 
571
_rngdoc  ?= `$(PKG_CONFIG) --variable rngdoc gnome-doc-utils`
 
572
_xsldoc  ?= `$(PKG_CONFIG) --variable xsldoc gnome-doc-utils`
 
573
_chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
 
574
_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
 
575
_ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
533
576
 
534
577
_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
535
578
 
536
579
# FIXME: Fix the dependancies
537
580
$(_RNGDOC_C_DOCS) : $(_RNGDOC_RNGS)
538
 
        xsltproc -o $@ $(call rngdoc_args,$@,$<)
 
581
        if ! test -d $(dir $@); then mkdir $(dir $@); fi;
 
582
        xsltproc $(call rngdoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
 
583
          cp $@.tmp $@ && rm -f $@.tmp
539
584
 
540
585
.PHONY: rngdoc
541
586
rngdoc: $(_RNGDOC_C_DOCS)
542
587
 
543
588
# FIXME: Fix the dependancies
544
589
$(_XSLDOC_C_DOCS) : $(_XSLDOC_XSLS)
545
 
        xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@
 
590
        if ! test -d $(dir $@); then mkdir $(dir $@); fi;
 
591
        xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
 
592
          cp $@.tmp $@ && rm -f $@.tmp
546
593
 
547
594
.PHONY: xsldoc
548
595
xsldoc: $(_XSLDOC_C_DOCS)
573
620
$(_CVSIGNORE_TOP) : $(_CVSIGNORE_TOP_FILES)
574
621
        if ! test -f $@; then touch $@; fi
575
622
        cat $@ > $@.tmp
576
 
        for file in $^; do \
 
623
        list='$^'; for file in $$list; do \
577
624
          echo $$file >> $@.tmp; \
578
625
        done
579
626
        cat $@.tmp | sort | uniq > $@
582
629
$(_CVSIGNORE_C) : $(_CVSIGNORE_C_FILES)
583
630
        if ! test -f $@; then touch $@; fi
584
631
        cat $@ > $@.tmp
585
 
        for file in $^; do \
 
632
        list='$^'; for file in $$list; do \
586
633
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
587
634
        done
588
635
        cat $@.tmp | sort | uniq > $@
591
638
$(_CVSIGNORE_LC) : $(_CVSIGNORE_LC_FILES)
592
639
        if ! test -f $@; then touch $@; fi
593
640
        cat $@ > $@.tmp
594
 
        for file in $(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*); do \
 
641
        list='$(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*)'; \
 
642
        for file in $$list; do \
595
643
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
596
644
        done
597
645
        cat $@.tmp | sort | uniq > $@
604
652
po: $(_DOC_POFILES)
605
653
 
606
654
$(_DOC_POFILES): $(_DOC_C_DOCS)
607
 
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
 
655
        @if ! test -d $(dir $@); then \
 
656
          echo "mkdir $(dir $@)"; \
 
657
          mkdir "$(dir $@)"; \
 
658
        fi
 
659
        @if test ! -f $@ -a -f $(srcdir)/$@; then \
 
660
          echo "cp $(srcdir)/$@ $@"; \
 
661
          cp "$(srcdir)/$@" "$@"; \
 
662
        fi;
 
663
        @docs=; \
 
664
        list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \
 
665
          if test -f $$doc; then \
 
666
            docs="$$docs ../$$doc"; \
 
667
          else \
 
668
            docs="$$docs ../$(srcdir)/$$doc"; \
 
669
          fi; \
 
670
        done; \
608
671
        if ! test -f $@; then \
 
672
          echo "(cd $(dir $@) && \
 
673
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
674
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \
609
675
          (cd $(dir $@) && \
610
 
            $(_xml2po) -e $(_DOC_C_DOCS_NOENT:%=../%) > $(notdir $@)); \
 
676
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
677
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \
611
678
        else \
 
679
          echo "(cd $(dir $@) && \
 
680
            $(_xml2po) -e -u $(notdir $@) $$docs)"; \
612
681
          (cd $(dir $@) && \
613
 
            $(_xml2po) -e -u $(basename $(notdir $@)) $(_DOC_C_DOCS_NOENT:%=../%)); \
 
682
            $(_xml2po) -e -u $(notdir $@) $$docs); \
614
683
        fi
615
684
 
616
685
# FIXME: fix the dependancy
617
686
# FIXME: hook xml2po up
618
687
$(_DOC_LC_DOCS) : $(_DOC_POFILES)
619
688
$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
 
689
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
 
690
        case "$(srcdir)" in /*) sd="$(srcdir)";; *) sd="../$(srcdir)";; esac; \
 
691
        if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$$sd/"; fi; \
620
692
        (cd $(dir $@) && \
621
 
          $(_xml2po) -p $(patsubst %/$(notdir $@),%,$@).po ../C/$(notdir $@) > $(notdir $@))
 
693
          $(_xml2po) -e -p \
 
694
            "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
 
695
            "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
 
696
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
 
697
.PHONY: pot
 
698
pot: $(_DOC_POT)
 
699
$(_DOC_POT): $(_DOC_C_DOCS_NOENT)
 
700
        $(_xml2po) -e -o $@ $^
622
701
 
623
702
$(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
624
703
        xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".html" $(_db2html) $(patsubst %.html,%.xml,$@)
625
704
 
626
 
################################################################################
627
 
 
628
705
all:                                                    \
629
706
        $(_DOC_C_DOCS)          $(_DOC_LC_DOCS)         \
630
707
        $(_DOC_OMF_ALL)         $(_DOC_DSK_ALL)         \
631
708
        $(_DOC_HTML_ALL)        $(_DOC_POFILES)
632
709
 
633
 
.PHONY: clean-rngdoc clean-xsldoc clean-omf clean-dsk clean-lc
634
 
 
635
 
clean-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
636
 
clean-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
637
 
clean-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
638
 
clean-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
639
 
clean-lc:  ; rm -f $(_DOC_LC_DOCS)
640
 
 
641
 
clean:                                                  \
642
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
643
 
        $(_clean_omf)           $(_clean_dsk)           \
644
 
        $(_clean_lc)
645
 
distclean:                                              \
646
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
647
 
        $(_clean_omf)           $(_clean_dsk)           \
648
 
        $(_clean_lc)
649
 
mostlyclean:                                            \
650
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
651
 
        $(_clean_omf)           $(_clean_dsk)           \
652
 
        $(_clean_lc)
653
 
maintainer-clean:                                       \
654
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
655
 
        $(_clean_omf)           $(_clean_dsk)           \
656
 
        $(_clean_lc)
657
 
 
658
 
.PHONY: dist-doc dist-fig dist-omf dist-dsk
 
710
.PHONY: clean-doc-rngdoc clean-doc-xsldoc clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
 
711
 
 
712
clean-doc-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
 
713
clean-doc-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
 
714
clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
 
715
clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
 
716
clean-doc-lc:
 
717
        rm -f $(_DOC_LC_DOCS)
 
718
        @list='$(_DOC_POFILES)'; for po in $$list; do \
 
719
          if ! test "$$po" -ef "$(srcdir)/$$po"; then \
 
720
            echo "rm -f $$po"; \
 
721
            rm -f "$$po"; \
 
722
          fi; \
 
723
        done
 
724
        @for lc in C $(DOC_LINGUAS); do \
 
725
          if test -f "$$lc/.xml2po.mo"; then \
 
726
            echo "rm -f $$lc/.xml2po.mo"; \
 
727
            rm -f "$$lc/.xml2po.mo"; \
 
728
          fi; \
 
729
        done
 
730
clean-doc-dir:
 
731
        @for lc in C $(DOC_LINGUAS); do \
 
732
          for dir in `find $$lc -depth -type d`; do \
 
733
            if ! test $$dir -ef $(srcdir)/$$dir; then \
 
734
              echo "rmdir $$dir"; \
 
735
              rmdir "$$dir"; \
 
736
           fi; \
 
737
          done; \
 
738
        done
 
739
 
 
740
clean-local:                                            \
 
741
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
742
        $(_clean_omf)           $(_clean_dsk)           \
 
743
        $(_clean_lc)            $(_clean_dir)
 
744
distclean-local:                                        \
 
745
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
746
        $(_clean_omf)           $(_clean_dsk)           \
 
747
        $(_clean_lc)            $(_clean_dir)
 
748
mostlyclean-local:                                      \
 
749
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
750
        $(_clean_omf)           $(_clean_dsk)           \
 
751
        $(_clean_lc)            $(_clean_dir)
 
752
maintainer-clean-local:                                 \
 
753
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
754
        $(_clean_omf)           $(_clean_dsk)           \
 
755
        $(_clean_lc)            $(_clean_dir)
 
756
 
 
757
.PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
659
758
doc-dist-hook:                                  \
660
 
        $(if $(DOC_MODULE),dist-doc)            \
661
 
        $(if $(DOC_FIGURES),dist-fig)           \
662
 
        $(if $(_DOC_OMF_IN),dist-omf)           \
663
 
        $(if $(_DOC_DSK_IN),dist-dsk)
 
759
        $(if $(DOC_MODULE),dist-doc-docs)       \
 
760
        $(if $(_DOC_C_FIGURES),dist-doc-figs)   \
 
761
        $(if $(_DOC_OMF_IN),dist-doc-omf)
 
762
#       $(if $(_DOC_DSK_IN),dist-doc-dsk)
664
763
 
665
 
dist-doc: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
 
764
dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
666
765
        @for lc in C $(DOC_LINGUAS); do \
667
766
          echo " $(mkinstalldirs) $(distdir)/$$lc"; \
668
767
          $(mkinstalldirs) "$(distdir)/$$lc"; \
669
768
        done
670
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES); do \
 
769
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \
 
770
        for doc in $$list; do \
671
771
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
672
772
          echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \
673
773
          $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \
674
774
        done
675
775
 
676
 
dist-fig: $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)
677
 
        @for lc in C $(DOC_LINGUAS); do \
678
 
          echo " $(mkinstalldirs) $(distdir)/$$lc/figures"; \
679
 
          $(mkinstalldirs) "$(distdir)/$$lc/figures"; \
680
 
        done;
681
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
 
776
dist-doc-figs: $(_DOC_SRC_FIGURES)
 
777
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \
 
778
        for fig in $$list; do \
682
779
          if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
683
 
          if test -f "$$dd$$fig"; then \
 
780
          if test -f "$$d$$fig"; then \
 
781
            figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
 
782
            if ! test -d "$(distdir)/$$figdir"; then \
 
783
              echo "$(mkinstalldirs) $(distdir)/$$figdir"; \
 
784
              $(mkinstalldirs) "$(distdir)/$$figdir"; \
 
785
            fi; \
684
786
            echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \
685
787
            $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \
686
788
          fi; \
687
789
        done;
688
790
 
689
 
dist-omf:
 
791
dist-doc-omf:
690
792
        @if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \
691
793
        echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \
692
794
        $(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))"
693
795
 
694
 
dist-dsk:
 
796
dist-doc-dsk:
695
797
        @if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \
696
798
        echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \
697
799
        $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))"
698
800
 
699
 
.PHONY: check-doc check-omf
 
801
.PHONY: check-doc-docs check-doc-omf
700
802
check:                                                  \
701
 
        $(if $(DOC_MODULE),check-doc)                   \
702
 
        $(if $(_DOC_OMF_IN),check-omf)
 
803
        $(if $(DOC_MODULE),check-doc-docs)              \
 
804
        $(if $(_DOC_OMF_IN),check-doc-omf)
703
805
 
704
 
check-doc: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
 
806
check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
705
807
        @for lc in C $(DOC_LINGUAS); do \
706
 
          if test -f "$$lc"; then d=; else d="$(srcdir)/"; fi; \
707
 
          echo " (cd $$d$$lc && xmllint --noout --xinclude --postvalid $(DOC_MODULE).xml)"; \
708
 
          (cd $$d$$lc && xmllint --noout --xinclude --postvalid $(DOC_MODULE).xml); \
 
808
          if test -f "$$lc"; \
 
809
            then d=; \
 
810
            xmlpath="$$lc"; \
 
811
          else \
 
812
            d="$(srcdir)/"; \
 
813
            xmlpath="$$lc:$(srcdir)/$$lc"; \
 
814
          fi; \
 
815
          echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \
 
816
          xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \
709
817
        done
710
818
 
711
 
check-omf: $(_DOC_OMF_ALL)
712
 
        @for omf in $(_DOC_OMF_ALL); do \
 
819
check-doc-omf: $(_DOC_OMF_ALL)
 
820
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
713
821
          echo "xmllint --noout --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \
714
822
          xmllint --noout --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \
715
823
        done
716
824
 
717
 
.PHONY: install-doc install-html install-fig install-omf install-dsk
 
825
.PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk
718
826
install-data-local:                                     \
719
 
        $(if $(DOC_MODULE),install-doc)                 \
720
 
        $(if $(_DOC_HTML_ALL),install-html)             \
721
 
        $(if $(DOC_FIGURES),install-fig)                \
722
 
        $(if $(_DOC_OMF_IN),install-omf)
723
 
#       $(if $(_DOC_DSK_IN),install-dsk)
 
827
        $(if $(DOC_MODULE),install-doc-docs)            \
 
828
        $(if $(_DOC_HTML_ALL),install-doc-html)         \
 
829
        $(if $(_DOC_C_FIGURES),install-doc-figs)        \
 
830
        $(if $(_DOC_OMF_IN),install-doc-omf)
 
831
#       $(if $(_DOC_DSK_IN),install-doc-dsk)
724
832
 
725
 
install-doc:
 
833
install-doc-docs:
726
834
        @for lc in C $(DOC_LINGUAS); do \
727
835
          echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc"; \
728
836
          $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc; \
729
837
        done
730
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS); do \
 
838
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
731
839
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
732
840
          echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
733
841
          $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc; \
734
842
        done
735
843
 
736
 
install-fig:
737
 
        @for lc in C $(DOC_LINGUAS); do \
738
 
          echo " $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc/figures"; \
739
 
          $(mkinstalldirs) "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc/figures"; \
740
 
        done;
741
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
742
 
          if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
743
 
          if test -f "$$dd$$fig"; then \
744
 
            echo "$(INSTALL_DATA) $$d$$fig $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
745
 
            $(INSTALL_DATA) "$$d$$fig $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
746
 
          fi; \
747
 
        done;
 
844
install-doc-figs:
 
845
        @list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \
 
846
          for lc in C $(DOC_LINGUAS); do \
 
847
            if test -f "$$lc/$$fig"; then \
 
848
              figfile="$$lc/$$fig"; \
 
849
            elif test -f "$(srcdir)/$$lc/$$fig"; then \
 
850
              figfile="$(srcdir)/$$lc/$$fig"; \
 
851
            elif test -f "C/$$fig"; then \
 
852
              figfile="C/$$fig"; \
 
853
            else \
 
854
              figfile="$(srcdir)/C/$$fig"; \
 
855
            fi; \
 
856
            figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
 
857
            figdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$figdir"; \
 
858
            if ! test -d "$$figdir"; then \
 
859
              echo "$(mkinstalldirs) $$figdir"; \
 
860
              $(mkinstalldirs) "$$figdir"; \
 
861
            fi; \
 
862
            figbase=`echo $$fig | sed -e 's/^.*\///'`; \
 
863
            echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \
 
864
            $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \
 
865
          done; \
 
866
        done
748
867
 
749
 
install-html:
 
868
install-doc-html:
750
869
        echo install-html
751
870
 
752
 
install-omf:
 
871
install-doc-omf:
753
872
        $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)
754
 
        @for omf in $(_DOC_OMF_ALL); do \
 
873
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
755
874
          echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
756
875
          $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf; \
757
876
        done
758
 
        -scrollkeeper-update -p "$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"
 
877
        @if test "x$(_ENABLE_SK)" = "xtrue"; then \
 
878
          echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
879
          scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
880
        fi;
759
881
 
760
 
install-dsk:
 
882
install-doc-dsk:
761
883
        echo install-dsk
762
884
 
763
 
.PHONY: uninstall-doc uninstall-html uninstall-omf uninstall-dsk
 
885
.PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk
764
886
uninstall-local:                                        \
765
 
        $(if $(DOC_MODULE),uninstall-doc)               \
766
 
        $(if $(_DOC_HTML_ALL),uninstall-html)           \
767
 
        $(if $(DOC_FIGURES),uninstall-fig)              \
768
 
        $(if $(_DOC_OMF_IN),uninstall-omf)
769
 
#       $(if $(_DOC_DSK_IN),uninstall-dsk)
 
887
        $(if $(DOC_MODULE),uninstall-doc-docs)          \
 
888
        $(if $(_DOC_HTML_ALL),uninstall-doc-html)       \
 
889
        $(if $(DOC_FIGURES),uninstall-doc-figs)         \
 
890
        $(if $(_DOC_OMF_IN),uninstall-doc-omf)
 
891
#       $(if $(_DOC_DSK_IN),uninstall-doc-dsk)
770
892
 
771
 
uninstall-doc:
772
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS); do \
 
893
uninstall-doc-docs:
 
894
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
773
895
          echo " rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
774
896
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
775
897
        done
776
898
 
777
 
uninstall-fig:
778
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
 
899
uninstall-doc-figs:
 
900
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \
779
901
          echo "rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
780
902
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
781
903
        done;
782
904
 
783
 
uninstall-omf:
784
 
        @for omf in $(_DOC_OMF_ALL); do \
785
 
          echo " scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
786
 
          scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
905
uninstall-doc-omf:
 
906
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
 
907
          if test "x$(_ENABLE_SK)" == "xtrue"; then \
 
908
            echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
909
            scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
910
          fi; \
787
911
          echo "rm -f $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
788
912
          rm -f "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
789
913
        done