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

« back to all changes in this revision

Viewing changes to 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
327
360
@ENABLE_BUILD_UTILS_TRUE@xml2po_SUBDIRS = xml2po
328
361
 
329
362
@ENABLE_BUILD_UTILS_TRUE@DOC_H_FILE = gnome-doc-utils.h
330
 
@ENABLE_BUILD_UTILS_TRUE@DOC_H_DOCS = doc/xslt/C/gnome-doc-xslt.xml doc/gnome-doc-make/C/gnome-doc-make.xml
 
363
@ENABLE_BUILD_UTILS_TRUE@DOC_H_DOCS = \
 
364
@ENABLE_BUILD_UTILS_TRUE@       doc/xslt/C/gnome-doc-xslt.xml           \
 
365
@ENABLE_BUILD_UTILS_TRUE@       doc/gnome-doc-make/C/gnome-doc-make.xml
 
366
 
331
367
 
332
368
@ENABLE_BUILD_UTILS_TRUE@aclocaldir = $(datadir)/aclocal
333
369
@ENABLE_BUILD_UTILS_TRUE@aclocal_DATA = gnome-doc-utils.m4
347
383
        $(aclocal_DATA)                                 \
348
384
        $(share_DATA)                                   \
349
385
        $(pkgconfig_DATA)                               \
 
386
        COPYING.GPL                                     \
 
387
        COPYING.LGPL                                    \
350
388
        bootstrap.make                                  \
351
389
        gnome-doc-prepare.in                            \
352
390
        intltool-extract.in                             \
361
399
        gnome-doc-utils.make
362
400
 
363
401
 
 
402
DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper
 
403
 
364
404
distuninstallcheck_listfiles = \
365
405
find -regex '.*/var/scrollkeeper/.*' -prune -or -type f -print
366
406
 
716
756
        @echo "it deletes files that may require special tools to rebuild."
717
757
clean: clean-recursive
718
758
 
719
 
clean-am: clean-generic mostlyclean-am
 
759
clean-am: clean-generic clean-local mostlyclean-am
720
760
 
721
761
distclean: distclean-recursive
722
762
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
723
 
distclean-am: clean-am distclean-generic distclean-tags
 
763
distclean-am: clean-am distclean-generic distclean-local distclean-tags
724
764
 
725
765
dvi: dvi-recursive
726
766
 
744
784
maintainer-clean: maintainer-clean-recursive
745
785
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
746
786
        -rm -rf autom4te.cache
747
 
maintainer-clean-am: distclean-am maintainer-clean-generic
 
787
maintainer-clean-am: distclean-am maintainer-clean-generic \
 
788
        maintainer-clean-local
748
789
 
749
790
mostlyclean: mostlyclean-recursive
750
791
 
751
 
mostlyclean-am: mostlyclean-generic
 
792
mostlyclean-am: mostlyclean-generic mostlyclean-local
752
793
 
753
794
uninstall-am: uninstall-aclocalDATA uninstall-binSCRIPTS \
754
795
        uninstall-info-am uninstall-local uninstall-pkgconfigDATA \
757
798
uninstall-info: uninstall-info-recursive
758
799
 
759
800
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
760
 
        clean-generic clean-recursive dist dist-all dist-gzip distcheck \
761
 
        distclean distclean-generic distclean-recursive distclean-tags \
762
 
        distcleancheck distdir dvi dvi-am dvi-recursive info info-am \
763
 
        info-recursive install install-aclocalDATA install-am \
764
 
        install-binSCRIPTS install-data install-data-am \
765
 
        install-data-local install-data-recursive install-exec \
766
 
        install-exec-am install-exec-recursive install-info \
767
 
        install-info-am install-info-recursive install-man \
 
801
        clean-generic clean-local clean-recursive dist dist-all \
 
802
        dist-gzip distcheck distclean distclean-generic distclean-local \
 
803
        distclean-recursive distclean-tags distcleancheck distdir dvi \
 
804
        dvi-am dvi-recursive info info-am info-recursive install \
 
805
        install-aclocalDATA install-am install-binSCRIPTS install-data \
 
806
        install-data-am install-data-local install-data-recursive \
 
807
        install-exec install-exec-am install-exec-recursive \
 
808
        install-info install-info-am install-info-recursive install-man \
768
809
        install-pkgconfigDATA install-recursive install-shareDATA \
769
810
        install-strip installcheck installcheck-am installdirs \
770
811
        installdirs-am installdirs-recursive maintainer-clean \
771
 
        maintainer-clean-generic maintainer-clean-recursive mostlyclean \
772
 
        mostlyclean-generic mostlyclean-recursive tags tags-recursive \
 
812
        maintainer-clean-generic maintainer-clean-local \
 
813
        maintainer-clean-recursive mostlyclean mostlyclean-generic \
 
814
        mostlyclean-local mostlyclean-recursive tags tags-recursive \
773
815
        uninstall uninstall-aclocalDATA uninstall-am \
774
816
        uninstall-binSCRIPTS uninstall-info-am uninstall-info-recursive \
775
817
        uninstall-local uninstall-pkgconfigDATA uninstall-recursive \
781
823
DOC_H_DOCS ?=
782
824
 
783
825
$(DOC_H_FILE): $(DOC_H_DOCS);
784
 
        @rm -f $@; touch $@;
785
 
        echo 'const gchar** documentation_credits = {' >> $@
786
 
        for doc in $(DOC_H_DOCS); do \
787
 
          xsltproc $(_credits) $$doc; \
 
826
        @rm -f $@.tmp; touch $@.tmp;
 
827
        echo 'const gchar* documentation_credits[] = {' >> $@.tmp
 
828
        list='$(DOC_H_DOCS)'; for doc in $$list; do \
 
829
          xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
 
830
          if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
 
831
          xsltproc --path "$$xmlpath" $(_credits) $$doc; \
788
832
        done | sort | uniq \
789
833
          | 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}}' \
790
 
          | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@
791
 
        echo '  NULL' >> $@
792
 
        echo '};' >> $@
793
 
        echo >> $@
794
 
        for doc in $(DOC_H_DOCS); do \
795
 
          docid=`echo $$doc  | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
 
834
          | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp
 
835
        echo '  NULL' >> $@.tmp
 
836
        echo '};' >> $@.tmp
 
837
        echo >> $@.tmp
 
838
        list='$(DOC_H_DOCS)'; for doc in $$list; do \
 
839
          xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
 
840
          if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
 
841
          docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
796
842
            | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
797
 
          ids=`xsltproc --xinclude $(_ids) $$doc`; \
 
843
          echo $$xmlpath; \
 
844
          ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
798
845
          for id in $$ids; do \
799
846
            echo '#define HELP_'`echo $$docid`'_'`echo $$id \
800
 
              | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@; \
 
847
              | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \
801
848
          done; \
802
 
          echo >> $@; \
 
849
          echo >> $@.tmp; \
803
850
        done;
 
851
        cp $@.tmp $@ && rm -f $@.tmp
804
852
 
805
 
.PHONY: dist-header
 
853
.PHONY: dist-doc-header
806
854
dist-doc-header: $(DOC_H_FILE)
807
 
        $(INSTALL_DATA) $(srcdir)/$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)
 
855
        @if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \
 
856
        echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \
 
857
        $(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)";
808
858
 
809
859
doc-dist-hook: $(if $(DOC_H_FILE),dist-doc-header)
810
860
 
811
 
.PHONY: chean-doc-header
812
 
clean: $(_clean_doc_header)
813
 
distclean: $(_clean_doc_header)
814
 
mostlyclean: $(_clean_doc_header)
815
 
maintainer-clean: $(_clean_doc_header)
 
861
.PHONY: clean-doc-header
 
862
clean-local: $(_clean_doc_header)
 
863
distclean-local: $(_clean_doc_header)
 
864
mostlyclean-local: $(_clean_doc_header)
 
865
maintainer-clean-local: $(_clean_doc_header)
816
866
clean-doc-header:
817
867
        rm -f $(DOC_H_FILE)
818
868
 
840
890
 
841
891
_xml2po ?= `which xml2po`
842
892
 
843
 
_db2html ?= `pkg-config --variable db2html gnome-doc-utils`
844
 
_db2omf  ?= `pkg-config --variable db2omf gnome-doc-utils`
845
 
_rngdoc  ?= `pkg-config --variable rngdoc gnome-doc-utils`
846
 
_xsldoc  ?= `pkg-config --variable xsldoc gnome-doc-utils`
847
 
_chunks  ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/chunks.xsl
848
 
_credits ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/credits.xsl
849
 
_ids ?= `pkg-congif --variable xmldir gnome-doc-utils`/xml/gnome/xslt/docbook/utils/ids.xsl
 
893
_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
 
894
_db2omf  ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
 
895
_rngdoc  ?= `$(PKG_CONFIG) --variable rngdoc gnome-doc-utils`
 
896
_xsldoc  ?= `$(PKG_CONFIG) --variable xsldoc gnome-doc-utils`
 
897
_chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
 
898
_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
 
899
_ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
850
900
 
851
901
_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
852
902
 
853
903
# FIXME: Fix the dependancies
854
904
$(_RNGDOC_C_DOCS) : $(_RNGDOC_RNGS)
855
 
        xsltproc -o $@ $(call rngdoc_args,$@,$<)
 
905
        if ! test -d $(dir $@); then mkdir $(dir $@); fi;
 
906
        xsltproc $(call rngdoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
 
907
          cp $@.tmp $@ && rm -f $@.tmp
856
908
 
857
909
.PHONY: rngdoc
858
910
rngdoc: $(_RNGDOC_C_DOCS)
859
911
 
860
912
# FIXME: Fix the dependancies
861
913
$(_XSLDOC_C_DOCS) : $(_XSLDOC_XSLS)
862
 
        xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@
 
914
        if ! test -d $(dir $@); then mkdir $(dir $@); fi;
 
915
        xsltproc $(call xsldoc_args,$@,$<) | xmllint --c14n - > $@.tmp && \
 
916
          cp $@.tmp $@ && rm -f $@.tmp
863
917
 
864
918
.PHONY: xsldoc
865
919
xsldoc: $(_XSLDOC_C_DOCS)
890
944
$(_CVSIGNORE_TOP) : $(_CVSIGNORE_TOP_FILES)
891
945
        if ! test -f $@; then touch $@; fi
892
946
        cat $@ > $@.tmp
893
 
        for file in $^; do \
 
947
        list='$^'; for file in $$list; do \
894
948
          echo $$file >> $@.tmp; \
895
949
        done
896
950
        cat $@.tmp | sort | uniq > $@
899
953
$(_CVSIGNORE_C) : $(_CVSIGNORE_C_FILES)
900
954
        if ! test -f $@; then touch $@; fi
901
955
        cat $@ > $@.tmp
902
 
        for file in $^; do \
 
956
        list='$^'; for file in $$list; do \
903
957
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
904
958
        done
905
959
        cat $@.tmp | sort | uniq > $@
908
962
$(_CVSIGNORE_LC) : $(_CVSIGNORE_LC_FILES)
909
963
        if ! test -f $@; then touch $@; fi
910
964
        cat $@ > $@.tmp
911
 
        for file in $(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*); do \
 
965
        list='$(wildcard $(_CVSIGNORE_LC_FILES),$(dir $@)/*)'; \
 
966
        for file in $$list; do \
912
967
          echo $$file | sed -e 's/.*\///' >> $@.tmp; \
913
968
        done
914
969
        cat $@.tmp | sort | uniq > $@
921
976
po: $(_DOC_POFILES)
922
977
 
923
978
$(_DOC_POFILES): $(_DOC_C_DOCS)
924
 
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
 
979
        @if ! test -d $(dir $@); then \
 
980
          echo "mkdir $(dir $@)"; \
 
981
          mkdir "$(dir $@)"; \
 
982
        fi
 
983
        @if test ! -f $@ -a -f $(srcdir)/$@; then \
 
984
          echo "cp $(srcdir)/$@ $@"; \
 
985
          cp "$(srcdir)/$@" "$@"; \
 
986
        fi;
 
987
        @docs=; \
 
988
        list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \
 
989
          if test -f $$doc; then \
 
990
            docs="$$docs ../$$doc"; \
 
991
          else \
 
992
            docs="$$docs ../$(srcdir)/$$doc"; \
 
993
          fi; \
 
994
        done; \
925
995
        if ! test -f $@; then \
 
996
          echo "(cd $(dir $@) && \
 
997
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
998
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \
926
999
          (cd $(dir $@) && \
927
 
            $(_xml2po) -e $(_DOC_C_DOCS_NOENT:%=../%) > $(notdir $@)); \
 
1000
            $(_xml2po) -e $$docs > $(notdir $@).tmp && \
 
1001
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \
928
1002
        else \
 
1003
          echo "(cd $(dir $@) && \
 
1004
            $(_xml2po) -e -u $(notdir $@) $$docs)"; \
929
1005
          (cd $(dir $@) && \
930
 
            $(_xml2po) -e -u $(basename $(notdir $@)) $(_DOC_C_DOCS_NOENT:%=../%)); \
 
1006
            $(_xml2po) -e -u $(notdir $@) $$docs); \
931
1007
        fi
932
1008
 
933
1009
# FIXME: fix the dependancy
934
1010
# FIXME: hook xml2po up
935
1011
$(_DOC_LC_DOCS) : $(_DOC_POFILES)
936
1012
$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
 
1013
        if ! test -d $(dir $@); then mkdir $(dir $@); fi
 
1014
        case "$(srcdir)" in /*) sd="$(srcdir)";; *) sd="../$(srcdir)";; esac; \
 
1015
        if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$$sd/"; fi; \
937
1016
        (cd $(dir $@) && \
938
 
          $(_xml2po) -p $(patsubst %/$(notdir $@),%,$@).po ../C/$(notdir $@) > $(notdir $@))
 
1017
          $(_xml2po) -e -p \
 
1018
            "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
 
1019
            "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
 
1020
            cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
 
1021
.PHONY: pot
 
1022
pot: $(_DOC_POT)
 
1023
$(_DOC_POT): $(_DOC_C_DOCS_NOENT)
 
1024
        $(_xml2po) -e -o $@ $^
939
1025
 
940
1026
$(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
941
1027
        xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".html" $(_db2html) $(patsubst %.html,%.xml,$@)
942
1028
 
943
 
################################################################################
944
 
 
945
1029
all:                                                    \
946
1030
        $(_DOC_C_DOCS)          $(_DOC_LC_DOCS)         \
947
1031
        $(_DOC_OMF_ALL)         $(_DOC_DSK_ALL)         \
948
1032
        $(_DOC_HTML_ALL)        $(_DOC_POFILES)
949
1033
 
950
 
.PHONY: clean-rngdoc clean-xsldoc clean-omf clean-dsk clean-lc
951
 
 
952
 
clean-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
953
 
clean-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
954
 
clean-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
955
 
clean-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
956
 
clean-lc:  ; rm -f $(_DOC_LC_DOCS)
957
 
 
958
 
clean:                                                  \
959
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
960
 
        $(_clean_omf)           $(_clean_dsk)           \
961
 
        $(_clean_lc)
962
 
distclean:                                              \
963
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
964
 
        $(_clean_omf)           $(_clean_dsk)           \
965
 
        $(_clean_lc)
966
 
mostlyclean:                                            \
967
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
968
 
        $(_clean_omf)           $(_clean_dsk)           \
969
 
        $(_clean_lc)
970
 
maintainer-clean:                                       \
971
 
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
972
 
        $(_clean_omf)           $(_clean_dsk)           \
973
 
        $(_clean_lc)
974
 
 
975
 
.PHONY: dist-doc dist-fig dist-omf dist-dsk
 
1034
.PHONY: clean-doc-rngdoc clean-doc-xsldoc clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
 
1035
 
 
1036
clean-doc-rngdoc: ; rm -f $(_RNGDOC_C_DOCS) $(_RNGDOC_LC_DOCS)
 
1037
clean-doc-xsldoc: ; rm -f $(_XSLDOC_C_DOCS) $(_XSLDOC_LC_DOCS)
 
1038
clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
 
1039
clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
 
1040
clean-doc-lc:
 
1041
        rm -f $(_DOC_LC_DOCS)
 
1042
        @list='$(_DOC_POFILES)'; for po in $$list; do \
 
1043
          if ! test "$$po" -ef "$(srcdir)/$$po"; then \
 
1044
            echo "rm -f $$po"; \
 
1045
            rm -f "$$po"; \
 
1046
          fi; \
 
1047
        done
 
1048
        @for lc in C $(DOC_LINGUAS); do \
 
1049
          if test -f "$$lc/.xml2po.mo"; then \
 
1050
            echo "rm -f $$lc/.xml2po.mo"; \
 
1051
            rm -f "$$lc/.xml2po.mo"; \
 
1052
          fi; \
 
1053
        done
 
1054
clean-doc-dir:
 
1055
        @for lc in C $(DOC_LINGUAS); do \
 
1056
          for dir in `find $$lc -depth -type d`; do \
 
1057
            if ! test $$dir -ef $(srcdir)/$$dir; then \
 
1058
              echo "rmdir $$dir"; \
 
1059
              rmdir "$$dir"; \
 
1060
           fi; \
 
1061
          done; \
 
1062
        done
 
1063
 
 
1064
clean-local:                                            \
 
1065
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
1066
        $(_clean_omf)           $(_clean_dsk)           \
 
1067
        $(_clean_lc)            $(_clean_dir)
 
1068
distclean-local:                                        \
 
1069
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
1070
        $(_clean_omf)           $(_clean_dsk)           \
 
1071
        $(_clean_lc)            $(_clean_dir)
 
1072
mostlyclean-local:                                      \
 
1073
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
1074
        $(_clean_omf)           $(_clean_dsk)           \
 
1075
        $(_clean_lc)            $(_clean_dir)
 
1076
maintainer-clean-local:                                 \
 
1077
        $(_clean_rngdoc)        $(_clean_xsldoc)        \
 
1078
        $(_clean_omf)           $(_clean_dsk)           \
 
1079
        $(_clean_lc)            $(_clean_dir)
 
1080
 
 
1081
.PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
976
1082
doc-dist-hook:                                  \
977
 
        $(if $(DOC_MODULE),dist-doc)            \
978
 
        $(if $(DOC_FIGURES),dist-fig)           \
979
 
        $(if $(_DOC_OMF_IN),dist-omf)           \
980
 
        $(if $(_DOC_DSK_IN),dist-dsk)
 
1083
        $(if $(DOC_MODULE),dist-doc-docs)       \
 
1084
        $(if $(_DOC_C_FIGURES),dist-doc-figs)   \
 
1085
        $(if $(_DOC_OMF_IN),dist-doc-omf)
 
1086
#       $(if $(_DOC_DSK_IN),dist-doc-dsk)
981
1087
 
982
 
dist-doc: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
 
1088
dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
983
1089
        @for lc in C $(DOC_LINGUAS); do \
984
1090
          echo " $(mkinstalldirs) $(distdir)/$$lc"; \
985
1091
          $(mkinstalldirs) "$(distdir)/$$lc"; \
986
1092
        done
987
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES); do \
 
1093
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \
 
1094
        for doc in $$list; do \
988
1095
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
989
1096
          echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \
990
1097
          $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \
991
1098
        done
992
1099
 
993
 
dist-fig: $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)
994
 
        @for lc in C $(DOC_LINGUAS); do \
995
 
          echo " $(mkinstalldirs) $(distdir)/$$lc/figures"; \
996
 
          $(mkinstalldirs) "$(distdir)/$$lc/figures"; \
997
 
        done;
998
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
 
1100
dist-doc-figs: $(_DOC_SRC_FIGURES)
 
1101
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \
 
1102
        for fig in $$list; do \
999
1103
          if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
1000
 
          if test -f "$$dd$$fig"; then \
 
1104
          if test -f "$$d$$fig"; then \
 
1105
            figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
 
1106
            if ! test -d "$(distdir)/$$figdir"; then \
 
1107
              echo "$(mkinstalldirs) $(distdir)/$$figdir"; \
 
1108
              $(mkinstalldirs) "$(distdir)/$$figdir"; \
 
1109
            fi; \
1001
1110
            echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \
1002
1111
            $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \
1003
1112
          fi; \
1004
1113
        done;
1005
1114
 
1006
 
dist-omf:
 
1115
dist-doc-omf:
1007
1116
        @if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \
1008
1117
        echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \
1009
1118
        $(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))"
1010
1119
 
1011
 
dist-dsk:
 
1120
dist-doc-dsk:
1012
1121
        @if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \
1013
1122
        echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \
1014
1123
        $(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))"
1015
1124
 
1016
 
.PHONY: check-doc check-omf
 
1125
.PHONY: check-doc-docs check-doc-omf
1017
1126
check:                                                  \
1018
 
        $(if $(DOC_MODULE),check-doc)                   \
1019
 
        $(if $(_DOC_OMF_IN),check-omf)
 
1127
        $(if $(DOC_MODULE),check-doc-docs)              \
 
1128
        $(if $(_DOC_OMF_IN),check-doc-omf)
1020
1129
 
1021
 
check-doc: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
 
1130
check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
1022
1131
        @for lc in C $(DOC_LINGUAS); do \
1023
 
          if test -f "$$lc"; then d=; else d="$(srcdir)/"; fi; \
1024
 
          echo " (cd $$d$$lc && xmllint --noout --xinclude --postvalid $(DOC_MODULE).xml)"; \
1025
 
          (cd $$d$$lc && xmllint --noout --xinclude --postvalid $(DOC_MODULE).xml); \
 
1132
          if test -f "$$lc"; \
 
1133
            then d=; \
 
1134
            xmlpath="$$lc"; \
 
1135
          else \
 
1136
            d="$(srcdir)/"; \
 
1137
            xmlpath="$$lc:$(srcdir)/$$lc"; \
 
1138
          fi; \
 
1139
          echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \
 
1140
          xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \
1026
1141
        done
1027
1142
 
1028
 
check-omf: $(_DOC_OMF_ALL)
1029
 
        @for omf in $(_DOC_OMF_ALL); do \
 
1143
check-doc-omf: $(_DOC_OMF_ALL)
 
1144
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
1030
1145
          echo "xmllint --noout --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \
1031
1146
          xmllint --noout --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \
1032
1147
        done
1033
1148
 
1034
 
.PHONY: install-doc install-html install-fig install-omf install-dsk
 
1149
.PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk
1035
1150
install-data-local:                                     \
1036
 
        $(if $(DOC_MODULE),install-doc)                 \
1037
 
        $(if $(_DOC_HTML_ALL),install-html)             \
1038
 
        $(if $(DOC_FIGURES),install-fig)                \
1039
 
        $(if $(_DOC_OMF_IN),install-omf)
1040
 
#       $(if $(_DOC_DSK_IN),install-dsk)
 
1151
        $(if $(DOC_MODULE),install-doc-docs)            \
 
1152
        $(if $(_DOC_HTML_ALL),install-doc-html)         \
 
1153
        $(if $(_DOC_C_FIGURES),install-doc-figs)        \
 
1154
        $(if $(_DOC_OMF_IN),install-doc-omf)
 
1155
#       $(if $(_DOC_DSK_IN),install-doc-dsk)
1041
1156
 
1042
 
install-doc:
 
1157
install-doc-docs:
1043
1158
        @for lc in C $(DOC_LINGUAS); do \
1044
1159
          echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc"; \
1045
1160
          $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc; \
1046
1161
        done
1047
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS); do \
 
1162
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
1048
1163
          if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
1049
1164
          echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
1050
1165
          $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc; \
1051
1166
        done
1052
1167
 
1053
 
install-fig:
1054
 
        @for lc in C $(DOC_LINGUAS); do \
1055
 
          echo " $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc/figures"; \
1056
 
          $(mkinstalldirs) "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc/figures"; \
1057
 
        done;
1058
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
1059
 
          if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
1060
 
          if test -f "$$dd$$fig"; then \
1061
 
            echo "$(INSTALL_DATA) $$d$$fig $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
1062
 
            $(INSTALL_DATA) "$$d$$fig $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
1063
 
          fi; \
1064
 
        done;
 
1168
install-doc-figs:
 
1169
        @list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \
 
1170
          for lc in C $(DOC_LINGUAS); do \
 
1171
            if test -f "$$lc/$$fig"; then \
 
1172
              figfile="$$lc/$$fig"; \
 
1173
            elif test -f "$(srcdir)/$$lc/$$fig"; then \
 
1174
              figfile="$(srcdir)/$$lc/$$fig"; \
 
1175
            elif test -f "C/$$fig"; then \
 
1176
              figfile="C/$$fig"; \
 
1177
            else \
 
1178
              figfile="$(srcdir)/C/$$fig"; \
 
1179
            fi; \
 
1180
            figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
 
1181
            figdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$figdir"; \
 
1182
            if ! test -d "$$figdir"; then \
 
1183
              echo "$(mkinstalldirs) $$figdir"; \
 
1184
              $(mkinstalldirs) "$$figdir"; \
 
1185
            fi; \
 
1186
            figbase=`echo $$fig | sed -e 's/^.*\///'`; \
 
1187
            echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \
 
1188
            $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \
 
1189
          done; \
 
1190
        done
1065
1191
 
1066
 
install-html:
 
1192
install-doc-html:
1067
1193
        echo install-html
1068
1194
 
1069
 
install-omf:
 
1195
install-doc-omf:
1070
1196
        $(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)
1071
 
        @for omf in $(_DOC_OMF_ALL); do \
 
1197
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
1072
1198
          echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
1073
1199
          $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf; \
1074
1200
        done
1075
 
        -scrollkeeper-update -p "$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"
 
1201
        @if test "x$(_ENABLE_SK)" = "xtrue"; then \
 
1202
          echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
1203
          scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
 
1204
        fi;
1076
1205
 
1077
 
install-dsk:
 
1206
install-doc-dsk:
1078
1207
        echo install-dsk
1079
1208
 
1080
 
.PHONY: uninstall-doc uninstall-html uninstall-omf uninstall-dsk
 
1209
.PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk
1081
1210
uninstall-local:                                        \
1082
 
        $(if $(DOC_MODULE),uninstall-doc)               \
1083
 
        $(if $(_DOC_HTML_ALL),uninstall-html)           \
1084
 
        $(if $(DOC_FIGURES),uninstall-fig)              \
1085
 
        $(if $(_DOC_OMF_IN),uninstall-omf)
1086
 
#       $(if $(_DOC_DSK_IN),uninstall-dsk)
 
1211
        $(if $(DOC_MODULE),uninstall-doc-docs)          \
 
1212
        $(if $(_DOC_HTML_ALL),uninstall-doc-html)       \
 
1213
        $(if $(DOC_FIGURES),uninstall-doc-figs)         \
 
1214
        $(if $(_DOC_OMF_IN),uninstall-doc-omf)
 
1215
#       $(if $(_DOC_DSK_IN),uninstall-doc-dsk)
1087
1216
 
1088
 
uninstall-doc:
1089
 
        @for doc in $(_DOC_C_DOCS) $(_DOC_LC_DOCS); do \
 
1217
uninstall-doc-docs:
 
1218
        @list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
1090
1219
          echo " rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
1091
1220
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
1092
1221
        done
1093
1222
 
1094
 
uninstall-fig:
1095
 
        @for fig in $(_DOC_C_FIGURES) $(_DOC_LC_FIGURES); do \
 
1223
uninstall-doc-figs:
 
1224
        @list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \
1096
1225
          echo "rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
1097
1226
          rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
1098
1227
        done;
1099
1228
 
1100
 
uninstall-omf:
1101
 
        @for omf in $(_DOC_OMF_ALL); do \
1102
 
          echo " scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
1103
 
          scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
1229
uninstall-doc-omf:
 
1230
        @list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
 
1231
          if test "x$(_ENABLE_SK)" == "xtrue"; then \
 
1232
            echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
1233
            scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
 
1234
          fi; \
1104
1235
          echo "rm -f $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
1105
1236
          rm -f "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
1106
1237
        done