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

« back to all changes in this revision

Viewing changes to doc/gnome-doc-make/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
406
439
        @echo "it deletes files that may require special tools to rebuild."
407
440
clean: clean-am
408
441
 
409
 
clean-am: clean-generic mostlyclean-am
 
442
clean-am: clean-generic clean-local mostlyclean-am
410
443
 
411
444
distclean: distclean-am
412
445
 
413
 
distclean-am: clean-am distclean-generic
 
446
distclean-am: clean-am distclean-generic distclean-local
414
447
 
415
448
dvi: dvi-am
416
449
 
432
465
 
433
466
maintainer-clean: maintainer-clean-am
434
467
 
435
 
maintainer-clean-am: distclean-am maintainer-clean-generic
 
468
maintainer-clean-am: distclean-am maintainer-clean-generic \
 
469
        maintainer-clean-local
436
470
 
437
471
mostlyclean: mostlyclean-am
438
472
 
439
 
mostlyclean-am: mostlyclean-generic
 
473
mostlyclean-am: mostlyclean-generic mostlyclean-local
440
474
 
441
475
uninstall-am: uninstall-info-am uninstall-local
442
476
 
443
 
.PHONY: all all-am check check-am clean clean-generic distclean \
444
 
        distclean-generic distdir dvi dvi-am info info-am install \
445
 
        install-am install-data install-data-am install-data-local \
446
 
        install-exec install-exec-am install-info install-info-am \
447
 
        install-man install-strip installcheck installcheck-am \
448
 
        installdirs maintainer-clean maintainer-clean-generic \
449
 
        mostlyclean mostlyclean-generic uninstall uninstall-am \
 
477
.PHONY: all all-am check check-am clean clean-generic clean-local \
 
478
        distclean distclean-generic distclean-local distdir dvi dvi-am \
 
479
        info info-am install install-am install-data install-data-am \
 
480
        install-data-local install-exec install-exec-am install-info \
 
481
        install-info-am install-man install-strip installcheck \
 
482
        installcheck-am installdirs maintainer-clean \
 
483
        maintainer-clean-generic maintainer-clean-local mostlyclean \
 
484
        mostlyclean-generic mostlyclean-local uninstall uninstall-am \
450
485
        uninstall-info-am uninstall-local
451
486
 
452
487
 
455
490
DOC_H_DOCS ?=
456
491
 
457
492
$(DOC_H_FILE): $(DOC_H_DOCS);
458
 
        @rm -f $@; touch $@;
459
 
        echo 'const gchar** documentation_credits = {' >> $@
460
 
        for doc in $(DOC_H_DOCS); do \
461
 
          xsltproc $(_credits) $$doc; \
 
493
        @rm -f $@.tmp; touch $@.tmp;
 
494
        echo 'const gchar* documentation_credits[] = {' >> $@.tmp
 
495
        list='$(DOC_H_DOCS)'; for doc in $$list; do \
 
496
          xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
 
497
          if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
 
498
          xsltproc --path "$$xmlpath" $(_credits) $$doc; \
462
499
        done | sort | uniq \
463
500
          | 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}}' \
464
 
          | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@
465
 
        echo '  NULL' >> $@
466
 
        echo '};' >> $@
467
 
        echo >> $@
468
 
        for doc in $(DOC_H_DOCS); do \
469
 
          docid=`echo $$doc  | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
 
501
          | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp
 
502
        echo '  NULL' >> $@.tmp
 
503
        echo '};' >> $@.tmp
 
504
        echo >> $@.tmp
 
505
        list='$(DOC_H_DOCS)'; for doc in $$list; do \
 
506
          xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
 
507
          if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
 
508
          docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
470
509
            | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
471
 
          ids=`xsltproc --xinclude $(_ids) $$doc`; \
 
510
          echo $$xmlpath; \
 
511
          ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
472
512
          for id in $$ids; do \
473
513
            echo '#define HELP_'`echo $$docid`'_'`echo $$id \
474
 
              | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@; \
 
514
              | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \
475
515
          done; \
476
 
          echo >> $@; \
 
516
          echo >> $@.tmp; \
477
517
        done;
 
518
        cp $@.tmp $@ && rm -f $@.tmp
478
519
 
479
 
.PHONY: dist-header
 
520
.PHONY: dist-doc-header
480
521
dist-doc-header: $(DOC_H_FILE)
481
 
        $(INSTALL_DATA) $(srcdir)/$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)
 
522
        @if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \
 
523
        echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \
 
524
        $(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)";
482
525
 
483
526
doc-dist-hook: $(if $(DOC_H_FILE),dist-doc-header)
484
527
 
485
 
.PHONY: chean-doc-header
486
 
clean: $(_clean_doc_header)
487
 
distclean: $(_clean_doc_header)
488
 
mostlyclean: $(_clean_doc_header)
489
 
maintainer-clean: $(_clean_doc_header)
 
528
.PHONY: clean-doc-header
 
529
clean-local: $(_clean_doc_header)
 
530
distclean-local: $(_clean_doc_header)
 
531
mostlyclean-local: $(_clean_doc_header)
 
532
maintainer-clean-local: $(_clean_doc_header)
490
533
clean-doc-header:
491
534
        rm -f $(DOC_H_FILE)
492
535
 
514
557
 
515
558
_xml2po ?= `which xml2po`
516
559
 
517
 
_db2html ?= `pkg-config --variable db2html gnome-doc-utils`
518
 
_db2omf  ?= `pkg-config --variable db2omf gnome-doc-utils`
519
 
_rngdoc  ?= `pkg-config --variable rngdoc gnome-doc-utils`
520
 
_xsldoc  ?= `pkg-config --variable xsldoc gnome-doc-utils`
521
 
_chunks  ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/chunks.xsl
522
 
_credits ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/credits.xsl
523
 
_ids ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/ids.xsl
 
560
_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
 
561
_db2omf  ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
 
562
_rngdoc  ?= `$(PKG_CONFIG) --variable rngdoc gnome-doc-utils`
 
563
_xsldoc  ?= `$(PKG_CONFIG) --variable xsldoc gnome-doc-utils`
 
564
_chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
 
565
_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
 
566
_ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
524
567
 
525
568
_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
526
569
 
527
570
# FIXME: Fix the dependancies
528
571
$(_RNGDOC_C_DOCS) : $(_RNGDOC_RNGS)
529
 
        xsltproc -o $@ $(call rngdoc_args,$@,$<)
 
572
        if ! test -d $(dir $@); then mkdir $(dir $@); fi;
 
573
        xsltproc $(call rngdoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
 
574
          cp $@.tmp $@ && rm -f $@.tmp
530
575
 
531
576
.PHONY: rngdoc
532
577
rngdoc: $(_RNGDOC_C_DOCS)
533
578
 
534
579
# FIXME: Fix the dependancies
535
580
$(_XSLDOC_C_DOCS) : $(_XSLDOC_XSLS)
536
 
        xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@
 
581
        if ! test -d $(dir $@); then mkdir $(dir $@); fi;
 
582
        xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
 
583
          cp $@.tmp $@ && rm -f $@.tmp
537
584
 
538
585
.PHONY: xsldoc
539
586
xsldoc: $(_XSLDOC_C_DOCS)
564
611
$(_CVSIGNORE_TOP) : $(_CVSIGNORE_TOP_FILES)
565
612
        if ! test -f $@; then touch $@; fi
566
613
        cat $@ > $@.tmp
567
 
        for file in $^; do \
 
614
        list='$^'; for file in $$list; do \
568
615
          echo $$file >> $@.tmp; \
569
616
        done
570
617
        cat $@.tmp | sort | uniq > $@
573
620
$(_CVSIGNORE_C) : $(_CVSIGNORE_C_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 | sed -e 's/.*\///' >> $@.tmp; \
578
625
        done
579
626
        cat $@.tmp | sort | uniq > $@
582
629
$(_CVSIGNORE_LC) : $(_CVSIGNORE_LC_FILES)
583
630
        if ! test -f $@; then touch $@; fi
584
631
        cat $@ > $@.tmp
585
 
        for file in $(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*); do \
 
632
        list='$(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*)'; \
 
633
        for file in $$list; do \
586
634
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
587
635
        done
588
636
        cat $@.tmp | sort | uniq > $@
595
643
po: $(_DOC_POFILES)
596
644
 
597
645
$(_DOC_POFILES): $(_DOC_C_DOCS)
598
 
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
 
646
        @if ! test -d $(dir $@); then \
 
647
          echo "mkdir $(dir $@)"; \
 
648
          mkdir "$(dir $@)"; \
 
649
        fi
 
650
        @if test ! -f $@ -a -f $(srcdir)/$@; then \
 
651
          echo "cp $(srcdir)/$@ $@"; \
 
652
          cp "$(srcdir)/$@" "$@"; \
 
653
        fi;
 
654
        @docs=; \
 
655
        list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \
 
656
          if test -f $$doc; then \
 
657
            docs="$$docs ../$$doc"; \
 
658
          else \
 
659
            docs="$$docs ../$(srcdir)/$$doc"; \
 
660
          fi; \
 
661
        done; \
599
662
        if ! test -f $@; then \
 
663
          echo "(cd $(dir $@) && \
 
664
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
665
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \
600
666
          (cd $(dir $@) && \
601
 
            $(_xml2po) -e $(_DOC_C_DOCS_NOENT:%=../%) > $(notdir $@)); \
 
667
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
668
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \
602
669
        else \
 
670
          echo "(cd $(dir $@) && \
 
671
            $(_xml2po) -e -u $(notdir $@) $$docs)"; \
603
672
          (cd $(dir $@) && \
604
 
            $(_xml2po) -e -u $(basename $(notdir $@)) $(_DOC_C_DOCS_NOENT:%=../%)); \
 
673
            $(_xml2po) -e -u $(notdir $@) $$docs); \
605
674
        fi
606
675
 
607
676
# FIXME: fix the dependancy
608
677
# FIXME: hook xml2po up
609
678
$(_DOC_LC_DOCS) : $(_DOC_POFILES)
610
679
$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
 
680
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
 
681
        case "$(srcdir)" in /*) sd="$(srcdir)";; *) sd="../$(srcdir)";; esac; \
 
682
        if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$$sd/"; fi; \
611
683
        (cd $(dir $@) && \
612
 
          $(_xml2po) -p $(patsubst %/$(notdir $@),%,$@).po ../C/$(notdir $@) > $(notdir $@))
 
684
          $(_xml2po) -e -p \
 
685
            "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
 
686
            "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
 
687
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
 
688
.PHONY: pot
 
689
pot: $(_DOC_POT)
 
690
$(_DOC_POT): $(_DOC_C_DOCS_NOENT)
 
691
        $(_xml2po) -e -o $@ $^
613
692
 
614
693
$(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
615
694
        xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".html" $(_db2html) $(patsubst %.html,%.xml,$@)
616
695
 
617
 
################################################################################
618
 
 
619
696
all:                                                    \
620
697
        $(_DOC_C_DOCS)          $(_DOC_LC_DOCS)         \
621
698
        $(_DOC_OMF_ALL)         $(_DOC_DSK_ALL)         \
622
699
        $(_DOC_HTML_ALL)        $(_DOC_POFILES)
623
700
 
624
 
.PHONY: clean-rngdoc clean-xsldoc clean-omf clean-dsk clean-lc
625
 
 
626
 
clean-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
627
 
clean-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
628
 
clean-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
629
 
clean-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
630
 
clean-lc:  ; rm -f $(_DOC_LC_DOCS)
631
 
 
632
 
clean:                                                  \
633
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
634
 
        $(_clean_omf)           $(_clean_dsk)           \
635
 
        $(_clean_lc)
636
 
distclean:                                              \
637
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
638
 
        $(_clean_omf)           $(_clean_dsk)           \
639
 
        $(_clean_lc)
640
 
mostlyclean:                                            \
641
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
642
 
        $(_clean_omf)           $(_clean_dsk)           \
643
 
        $(_clean_lc)
644
 
maintainer-clean:                                       \
645
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
646
 
        $(_clean_omf)           $(_clean_dsk)           \
647
 
        $(_clean_lc)
648
 
 
649
 
.PHONY: dist-doc dist-fig dist-omf dist-dsk
 
701
.PHONY: clean-doc-rngdoc clean-doc-xsldoc clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
 
702
 
 
703
clean-doc-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
 
704
clean-doc-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
 
705
clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
 
706
clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
 
707
clean-doc-lc:
 
708
        rm -f $(_DOC_LC_DOCS)
 
709
        @list='$(_DOC_POFILES)'; for po in $$list; do \
 
710
          if ! test "$$po" -ef "$(srcdir)/$$po"; then \
 
711
            echo "rm -f $$po"; \
 
712
            rm -f "$$po"; \
 
713
          fi; \
 
714
        done
 
715
        @for lc in C $(DOC_LINGUAS); do \
 
716
          if test -f "$$lc/.xml2po.mo"; then \
 
717
            echo "rm -f $$lc/.xml2po.mo"; \
 
718
            rm -f "$$lc/.xml2po.mo"; \
 
719
          fi; \
 
720
        done
 
721
clean-doc-dir:
 
722
        @for lc in C $(DOC_LINGUAS); do \
 
723
          for dir in `find $$lc -depth -type d`; do \
 
724
            if ! test $$dir -ef $(srcdir)/$$dir; then \
 
725
              echo "rmdir $$dir"; \
 
726
              rmdir "$$dir"; \
 
727
           fi; \
 
728
          done; \
 
729
        done
 
730
 
 
731
clean-local:                                            \
 
732
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
733
        $(_clean_omf)           $(_clean_dsk)           \
 
734
        $(_clean_lc)            $(_clean_dir)
 
735
distclean-local:                                        \
 
736
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
737
        $(_clean_omf)           $(_clean_dsk)           \
 
738
        $(_clean_lc)            $(_clean_dir)
 
739
mostlyclean-local:                                      \
 
740
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
741
        $(_clean_omf)           $(_clean_dsk)           \
 
742
        $(_clean_lc)            $(_clean_dir)
 
743
maintainer-clean-local:                                 \
 
744
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
745
        $(_clean_omf)           $(_clean_dsk)           \
 
746
        $(_clean_lc)            $(_clean_dir)
 
747
 
 
748
.PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
650
749
doc-dist-hook:                                  \
651
 
        $(if $(DOC_MODULE),dist-doc)            \
652
 
        $(if $(DOC_FIGURES),dist-fig)           \
653
 
        $(if $(_DOC_OMF_IN),dist-omf)           \
654
 
        $(if $(_DOC_DSK_IN),dist-dsk)
 
750
        $(if $(DOC_MODULE),dist-doc-docs)       \
 
751
        $(if $(_DOC_C_FIGURES),dist-doc-figs)   \
 
752
        $(if $(_DOC_OMF_IN),dist-doc-omf)
 
753
#       $(if $(_DOC_DSK_IN),dist-doc-dsk)
655
754
 
656
 
dist-doc: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
 
755
dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
657
756
        @for lc in C $(DOC_LINGUAS); do \
658
757
          echo " $(mkinstalldirs) $(distdir)/$$lc"; \
659
758
          $(mkinstalldirs) "$(distdir)/$$lc"; \
660
759
        done
661
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES); do \
 
760
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \
 
761
        for doc in $$list; do \
662
762
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
663
763
          echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \
664
764
          $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \
665
765
        done
666
766
 
667
 
dist-fig: $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)
668
 
        @for lc in C $(DOC_LINGUAS); do \
669
 
          echo " $(mkinstalldirs) $(distdir)/$$lc/figures"; \
670
 
          $(mkinstalldirs) "$(distdir)/$$lc/figures"; \
671
 
        done;
672
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
 
767
dist-doc-figs: $(_DOC_SRC_FIGURES)
 
768
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \
 
769
        for fig in $$list; do \
673
770
          if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
674
 
          if test -f "$$dd$$fig"; then \
 
771
          if test -f "$$d$$fig"; then \
 
772
            figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
 
773
            if ! test -d "$(distdir)/$$figdir"; then \
 
774
              echo "$(mkinstalldirs) $(distdir)/$$figdir"; \
 
775
              $(mkinstalldirs) "$(distdir)/$$figdir"; \
 
776
            fi; \
675
777
            echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \
676
778
            $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \
677
779
          fi; \
678
780
        done;
679
781
 
680
 
dist-omf:
 
782
dist-doc-omf:
681
783
        @if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \
682
784
        echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \
683
785
        $(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))"
684
786
 
685
 
dist-dsk:
 
787
dist-doc-dsk:
686
788
        @if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \
687
789
        echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \
688
790
        $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))"
689
791
 
690
 
.PHONY: check-doc check-omf
 
792
.PHONY: check-doc-docs check-doc-omf
691
793
check:                                                  \
692
 
        $(if $(DOC_MODULE),check-doc)                   \
693
 
        $(if $(_DOC_OMF_IN),check-omf)
 
794
        $(if $(DOC_MODULE),check-doc-docs)              \
 
795
        $(if $(_DOC_OMF_IN),check-doc-omf)
694
796
 
695
 
check-doc: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
 
797
check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
696
798
        @for lc in C $(DOC_LINGUAS); do \
697
 
          if test -f "$$lc"; then d=; else d="$(srcdir)/"; fi; \
698
 
          echo " (cd $$d$$lc && xmllint --noout --xinclude --postvalid $(DOC_MODULE).xml)"; \
699
 
          (cd $$d$$lc && xmllint --noout --xinclude --postvalid $(DOC_MODULE).xml); \
 
799
          if test -f "$$lc"; \
 
800
            then d=; \
 
801
            xmlpath="$$lc"; \
 
802
          else \
 
803
            d="$(srcdir)/"; \
 
804
            xmlpath="$$lc:$(srcdir)/$$lc"; \
 
805
          fi; \
 
806
          echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \
 
807
          xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \
700
808
        done
701
809
 
702
 
check-omf: $(_DOC_OMF_ALL)
703
 
        @for omf in $(_DOC_OMF_ALL); do \
 
810
check-doc-omf: $(_DOC_OMF_ALL)
 
811
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
704
812
          echo "xmllint --noout --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \
705
813
          xmllint --noout --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \
706
814
        done
707
815
 
708
 
.PHONY: install-doc install-html install-fig install-omf install-dsk
 
816
.PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk
709
817
install-data-local:                                     \
710
 
        $(if $(DOC_MODULE),install-doc)                 \
711
 
        $(if $(_DOC_HTML_ALL),install-html)             \
712
 
        $(if $(DOC_FIGURES),install-fig)                \
713
 
        $(if $(_DOC_OMF_IN),install-omf)
714
 
#       $(if $(_DOC_DSK_IN),install-dsk)
 
818
        $(if $(DOC_MODULE),install-doc-docs)            \
 
819
        $(if $(_DOC_HTML_ALL),install-doc-html)         \
 
820
        $(if $(_DOC_C_FIGURES),install-doc-figs)        \
 
821
        $(if $(_DOC_OMF_IN),install-doc-omf)
 
822
#       $(if $(_DOC_DSK_IN),install-doc-dsk)
715
823
 
716
 
install-doc:
 
824
install-doc-docs:
717
825
        @for lc in C $(DOC_LINGUAS); do \
718
826
          echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc"; \
719
827
          $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc; \
720
828
        done
721
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS); do \
 
829
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
722
830
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
723
831
          echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
724
832
          $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc; \
725
833
        done
726
834
 
727
 
install-fig:
728
 
        @for lc in C $(DOC_LINGUAS); do \
729
 
          echo " $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc/figures"; \
730
 
          $(mkinstalldirs) "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc/figures"; \
731
 
        done;
732
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
733
 
          if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
734
 
          if test -f "$$dd$$fig"; then \
735
 
            echo "$(INSTALL_DATA) $$d$$fig $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
736
 
            $(INSTALL_DATA) "$$d$$fig $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
737
 
          fi; \
738
 
        done;
 
835
install-doc-figs:
 
836
        @list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \
 
837
          for lc in C $(DOC_LINGUAS); do \
 
838
            if test -f "$$lc/$$fig"; then \
 
839
              figfile="$$lc/$$fig"; \
 
840
            elif test -f "$(srcdir)/$$lc/$$fig"; then \
 
841
              figfile="$(srcdir)/$$lc/$$fig"; \
 
842
            elif test -f "C/$$fig"; then \
 
843
              figfile="C/$$fig"; \
 
844
            else \
 
845
              figfile="$(srcdir)/C/$$fig"; \
 
846
            fi; \
 
847
            figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
 
848
            figdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$figdir"; \
 
849
            if ! test -d "$$figdir"; then \
 
850
              echo "$(mkinstalldirs) $$figdir"; \
 
851
              $(mkinstalldirs) "$$figdir"; \
 
852
            fi; \
 
853
            figbase=`echo $$fig | sed -e 's/^.*\///'`; \
 
854
            echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \
 
855
            $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \
 
856
          done; \
 
857
        done
739
858
 
740
 
install-html:
 
859
install-doc-html:
741
860
        echo install-html
742
861
 
743
 
install-omf:
 
862
install-doc-omf:
744
863
        $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)
745
 
        @for omf in $(_DOC_OMF_ALL); do \
 
864
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
746
865
          echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
747
866
          $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf; \
748
867
        done
749
 
        -scrollkeeper-update -p "$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"
 
868
        @if test "x$(_ENABLE_SK)" = "xtrue"; then \
 
869
          echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
870
          scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
871
        fi;
750
872
 
751
 
install-dsk:
 
873
install-doc-dsk:
752
874
        echo install-dsk
753
875
 
754
 
.PHONY: uninstall-doc uninstall-html uninstall-omf uninstall-dsk
 
876
.PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk
755
877
uninstall-local:                                        \
756
 
        $(if $(DOC_MODULE),uninstall-doc)               \
757
 
        $(if $(_DOC_HTML_ALL),uninstall-html)           \
758
 
        $(if $(DOC_FIGURES),uninstall-fig)              \
759
 
        $(if $(_DOC_OMF_IN),uninstall-omf)
760
 
#       $(if $(_DOC_DSK_IN),uninstall-dsk)
 
878
        $(if $(DOC_MODULE),uninstall-doc-docs)          \
 
879
        $(if $(_DOC_HTML_ALL),uninstall-doc-html)       \
 
880
        $(if $(DOC_FIGURES),uninstall-doc-figs)         \
 
881
        $(if $(_DOC_OMF_IN),uninstall-doc-omf)
 
882
#       $(if $(_DOC_DSK_IN),uninstall-doc-dsk)
761
883
 
762
 
uninstall-doc:
763
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS); do \
 
884
uninstall-doc-docs:
 
885
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
764
886
          echo " rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
765
887
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
766
888
        done
767
889
 
768
 
uninstall-fig:
769
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
 
890
uninstall-doc-figs:
 
891
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \
770
892
          echo "rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
771
893
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
772
894
        done;
773
895
 
774
 
uninstall-omf:
775
 
        @for omf in $(_DOC_OMF_ALL); do \
776
 
          echo " scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
777
 
          scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
896
uninstall-doc-omf:
 
897
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
 
898
          if test "x$(_ENABLE_SK)" == "xtrue"; then \
 
899
            echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
900
            scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
901
          fi; \
778
902
          echo "rm -f $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
779
903
          rm -f "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
780
904
        done