docs/reference/Makefile.am: fix version.dir.xml generation
[nautilus-actions.git] / docs / manual / Makefile.am
blob1da88a9636d0dd8ae0758482828b5c7be886e8ed
1 # FileManager-Actions
2 # A file-manager extension which offers configurable context menu actions.
4 # Copyright (C) 2005 The GNOME Foundation
5 # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
6 # Copyright (C) 2009-2015 Pierre Wieser and others (see AUTHORS)
8 # FileManager-Actions is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # FileManager-Actions is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with FileManager-Actions; see the file COPYING. If not, see
20 # <http://www.gnu.org/licenses/>.
22 # Authors:
23 #   Frederic Ruaudel <grumz@grumz.net>
24 #   Rodrigo Moya <rodrigo@gnome-db.org>
25 #   Pierre Wieser <pwieser@trychlos.org>
26 #   ... and many others (see AUTHORS)
28 # from Migrating your documentation to gnome-doc-utils
29 # http://live.gnome.org/GnomeDocUtilsMigrationHowTo
31 # The gnome-doc-utils packages produces the FileManager-Actions
32 # Configuration Tool Users's Manual as DocBook XML documents, suitable
33 # for Yelp, the Gnome help system.
35 # At install time, it installs these .xml help files
36 # in <datadir>/gnome/help/fma-config-tool/<lang>.
37 # Missing tranlated images are replaced with symlinks to
38 # ../../C/figures/<image.png>.
40 # --enable-html-manuals (resp. --enable-pdf-manuals) are configure
41 # options which produce HTML (resp. PDF) formats. These options are
42 # always enabled when making distcheck, so that all output formats for
43 # all known locales are always included in the distributed tarball.
45 # Do not confuse gnome-doc-utils which targets the help documentation
46 # of the Gnome (i.e. gui) applications, and that we are using here to
47 # generate html and pdf FMACT user's manuals, with gtk-doc which rather
48 # targets the developer documentation (see docs/reference).
50 # Do not use the $(NULL) syntax here as this may prevent Damned-Lies
51 # to correctly generate POT files (cf. mail of Claude Paroz 2010-08-29
52 # http://mail.gnome.org/archives/gnome-i18n/2010-August/msg00229.html).
54 DOC_MODULE = fma-config-tool
56 #DOC_ENTITIES = $(patsubst $(srcdir)/C/%,%,$(shell \ls -1 $(srcdir)/C/*.xml | $(GREP) -v $(DOC_MODULE)))
57 DOC_ENTITIES = \
58         appendix-gnu-fdl-1.3.xml                                                \
59         articleinfo.xml                                                                 \
60         fma-bugs.xml                                                                    \
61         fma-conditions.xml                                                              \
62         fma-config-tool.xml                                                             \
63         fma-edit.xml                                                                    \
64         fma-execution.xml                                                               \
65         fma-export.xml                                                                  \
66         fma-import.xml                                                                  \
67         fma-menus.xml                                                                   \
68         fma-misc.xml                                                                    \
69         fma-prefs.xml                                                                   \
70         fma-profiles.xml                                                                \
71         fma-properties.xml                                                              \
72         fma-save.xml                                                                    \
73         fma-sorting.xml                                                                 \
74         fma-starting.xml                                                                \
75         fma-where.xml                                                                   \
76         legalnotice.xml
78 #DOC_INCLUDES =
80 #DOC_FIGURES = $(patsubst $(srcdir)/C/%,%,$(shell \ls -1 $(srcdir)/C/figures/*.png))
81 DOC_FIGURES = \
82         figures/add.png                                                                 \
83         figures/fma-action-tab.png                                              \
84         figures/fma-basenames-tab.png                                   \
85         figures/fma-capabilities-tab.png                                \
86         figures/fma-command-tab.png                                             \
87         figures/fma-desktop-environment-frame.png               \
88         figures/fma-environment-tab.png                                 \
89         figures/fma-exec-mode-frame.png                                 \
90         figures/fma-execute-as-frame.png                                \
91         figures/fma-execution-environment-frame.png             \
92         figures/fma-execution-tab.png                                   \
93         figures/fma-export-done.png                                             \
94         figures/fma-export-format.png                                   \
95         figures/fma-export-home.png                                             \
96         figures/fma-export-items.png                                    \
97         figures/fma-export-summary.png                                  \
98         figures/fma-export-target.png                                   \
99         figures/fma-folders-tab.png                                             \
100         figures/fma-import-done.png                                             \
101         figures/fma-import-files.png                                    \
102         figures/fma-import-home.png                                             \
103         figures/fma-import-mode.png                                             \
104         figures/fma-import-resultat.png                                 \
105         figures/fma-import-summary.png                                  \
106         figures/fma-legend.png                                                  \
107         figures/fma-main-empty.png                                              \
108         figures/fma-mimetypes-tab.png                                   \
109         figures/fma-new-capability.png                                  \
110         figures/fma-new-scheme.png                                              \
111         figures/fma-preferences-desktop.png                             \
112         figures/fma-preferences-execution.png                   \
113         figures/fma-preferences-export.png                              \
114         figures/fma-preferences-import.png                              \
115         figures/fma-preferences-io-providers.png                \
116         figures/fma-preferences-runtime.png                             \
117         figures/fma-preferences-schemes.png                             \
118         figures/fma-preferences-ui.png                                  \
119         figures/fma-properties-tab.png                                  \
120         figures/fma-schemes-tab.png                                             \
121         figures/fma-selection-count-frame.png                   \
122         figures/fma-startup-mode-frame.png                              \
123         figures/fma-target-location.png                                 \
124         figures/fma-working-directory-frame.png                 \
125         figures/read-only.png                                                   \
126         figures/remove.png                                                              \
127         figures/sort-asc.png                                                    \
128         figures/sort-buttons-frame.png                                  \
129         figures/sort-desc.png                                                   \
130         figures/sort-manual.png                                                 \
131         figures/start-context-menu-nautilus.png                 \
132         figures/start-zenity-result.png                                 \
133         figures/stock-icon-about.png
135 if BUILD_HTML_MANUALS
136 include $(top_srcdir)/gnome-doc-utils.make
137 else
138 if BUILD_PDF_MANUALS
139 include $(top_srcdir)/gnome-doc-utils.make
140 endif
141 endif
143 #DOC_LINGUAS = $(patsubst $(srcdir)/%,%,$(shell find $(srcdir) -mindepth 1 -maxdepth 1 -type d | $(GREP) -v $(srcdir)/C))
144 DOC_LINGUAS = de el es fr sl
146 # doc-dist-hook is the dist hook provided by gnome-doc-utils.make
147 # it distributes both C (original) and generated (translated) .xml files,
148 # but not generated .omf files
149 dist-hook: omf-dist-hook doc-dist-hook manuals-dist-hook
151 # Distributing .omf files is required if we want the user be able to
152 # get rid of gnome-doc-utils
153 omf-dist-hook:
154         @for lc in C $(DOC_LINGUAS); do \
155                 omf="$(DOC_MODULE)-$$lc.omf"; \
156                 if test -f $(builddir)/$$omf; then d=$(builddir); \
157                 elif test -f $(srcdir)/$$lc/$$omf; then d=$(srcdir)/$$lc; fi; \
158                 if test -f "$$d/$$omf"; then \
159                         if test "$(opt_verbose)" = ""; then echo "  Distributing $$omf"; fi; \
160                         $(MKDIR_P) $(distdir)/$$lc; \
161                         cmd="cp $$d/$$omf $(distdir)/$$lc/"; eval $$cmd; \
162                         if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
163                 fi; \
164         done
166 # gnome-doc-utils doesn't provide by itself html nor pdf targets
167 # generate these formats here
169 # set to '-v' to be verbose (much verbose!)
170 #opt_verbose =
171 opt_verbose = -v
173 pkgdocdir = $(datarootdir)/doc/@PACKAGE@-@VERSION@
175 all-local: all-manuals
177 #all-manuals: install-C-xml all-html-manuals all-pdf-manuals
178 all-manuals: install-C-xml all-html-manuals 
180 # this install-data-local target below is executed after the 
181 # gnome-doc-utils.make install-data-local target (and this is an
182 # unexpected, though welcome, behavior)
183 install-data-local: install-manuals
185 #install-manuals: install-html-manuals install-pdf-manuals
186 install-manuals: install-html-manuals
188 #uninstall-local: uninstall-manuals
189 uninstall-doc-html: uninstall-manuals
191 uninstall-manuals: uninstall-html-manuals uninstall-pdf-manuals
193 #manuals-dist-hook: html-manuals-dist-hook pdf-manuals-dist-hook
194 manuals-dist-hook: html-manuals-dist-hook
196 # when building the manuals, C source files are in srcdir, while all
197 # other xml files are in builddir - installing C xml sources in builddir
198 # so that all rules apply
199 install-C-xml:
200         @if ! test -f C/$(DOC_MODULE).xml; then \
201                 echo "Installing C xml source files in $(abs_builddir)"; \
202                 $(MKDIR_P) C; cp -v $(srcdir)/C/*.xml C/; \
203         fi
205 remove-C-xml:
206         @echo "Removing C xml source files from $(abs_builddir)"
207         @if test "$(abs_srcdir)" != "$(abs_builddir)"; then \
208                 rm -vf C/*.xml; \
209         fi
211 # _DOC_LC_DOCS is the list of the translated (not C) DOC_MODULE.xml files
212 # we so are sure that they exist and are up to date
213 # (path is .po ->[msgfmt]-> .mo ->[xml2po]-> .xml)
214 MANUALS_XML = C/$(DOC_MODULE).xml $(_DOC_LC_DOCS)
215 MAINTAINERCLEANFILES =
217 # Build HTML manuals as $(builddir)/<lang>/<module>.html
219 # We have two alternative for generating HTML manual:
220 # - gnome-doc-tool (from gnome-doc-utils package)
221 # - db2html (from docbook-utils package)
222 # The actual tool to be used may be specified as an argument of
223 # --enable-html-manuals configure option. It defaults to gnome-doc-tool.
225 # gnome-doc-tool <format> -o <dir> -d0 nautilus-actions-config-tool.xml
226 # - format: output format (html)
227 # - dir: output directory
228 # -d0: nochunks
230 # The produced output is very close of what Yelp gives, with in particular
231 # a summary in each chapter while db2html does not produce it.
233 # As of v 0.20.1:
234 # - does not produce the legal and abstract sections in top of the document
235 # - does not honor external links: they are converted to simple links
236 #   which target the same frame window.
237 # - embeds references to 'admon-xxx' images (which are the equivalent
238 #   of db2html's 'stylesheet-images' ones), but does not provide them
239 #   (see https://bugzilla.gnome.org/show_bug.cgi?id=636175)
240 #   and so we 'manually' copy them as a "admon/" subdirectory
241 #   the same way db2html does
242 # - does not honor the base directory of the source document, only
243 #   searching for extern entities in the current working directory
244 #   (see https://bugzilla.gnome.org/show_bug.cgi?id=664784)
246 # gnome-doc-tool is so our preferred tool for its proximity with Yelp
247 # and the summary in top of the chapters.
249 # db2html --nochunks nautilus-actions-config-tool.xml
250 # Generate the html document(s).
252 # As of 0.6.14.29:
253 # - does produce the legal and abstract sections in top of the document
254 # - creates a stylesheet-images/ subdirectory
255 # - does not honor external links: they are converted to simple links
256 #   which target the same frame window
257 # - may create docbook2html-dir(.junk) subdirectories when it is run
258 #   without argument
259 #   (see https://bugzilla.redhat.com/show_bug.cgi?id=756930)
260 # - begins by emptying the target directory, even if it also contains
261 #   the source file
263 # When building HTML and PDF formats from XML sources, note that the
264 # .xml documents default to be read from <srcdir> for the C version,
265 # and from <builddir> for translated ones.
267 MANUALS_HTML = $(MANUALS_XML:%.xml=%.html)
268 MAINTAINERCLEANFILES += $(MANUALS_HTML)
270 if BUILD_HTML_MANUALS
271 all-html-manuals: $(MANUALS_HTML)
272 else
273 all-html-manuals:
274 endif
276 # The rule here is: only rebuild html/ files if corresponding xml has changed
277 # .xml themselves are distributed, so are not modified when building from a
278 # distributed package.
280 $(MANUALS_HTML): %.html: %.xml
281         @ftarget=$@; \
282         if test "$(opt_verbose)" = ""; then echo "  HTML   $$ftarget building..."; fi; \
283         lc=$${ftarget%/*}; \
284         if test "x$(WITH_DB2HTML)" = "xyes"; then $(call exec_db2html,$$lc); fi; \
285         if test "x$(WITH_GDT)" = "xyes"; then $(call exec_g_d_t,$$lc); fi; \
286         if test "$(opt_verbose)" = ""; then echo "  HTML   $$ftarget done"; fi
288 # execute gnome-doc-tool
289 # install admon/ images now to keep consistent with db2html which
290 # installs its stylesheet-images/ at build time
291 # as a result, admon/stylesheet images will be copied once for each
292 # language, instead of begin symlinked (a small inconvenience)
293 # 1. locale
294 exec_g_d_t = \
295         fxml=$(DOC_MODULE).xml; \
296         (cd $(1); \
297          cmd="gnome-doc-tool html -o . -d0 $$fxml"; \
298          if test "$(opt_verbose)" != ""; then echo "$$cmd"; fi; \
299          eval $$cmd >/dev/null; \
300          fhtml=$(DOC_MODULE).html; \
301          if test -f $$fhtml; then \
302                 sed -i -e 's?url("admon?url("admon/admon?' $$fhtml; \
303                 admon_dir=/usr/share/gnome-doc-utils/icons/hicolor/48x48/status; \
304                 if test -d $$admon_dir; then \
305                         $(MKDIR_P) -m 0775 admon; \
306                         cmd="cp $(opt_verbose) $$admon_dir/*.png admon/"; eval $$cmd; \
307                 fi; \
308          fi; \
309         )
311 # execute db2html
312 # 1. locale
313 exec_db2html = \
314         cddir="$(1)"; \
315         output="."; \
316         fxml=$(DOC_MODULE).xml; \
317         cmd="(cd $$cddir && db2html --output $$output --nochunks $$fxml)"; \
318         if test "$(opt_verbose)" != ""; then echo "$$cmd"; fi; \
319         eval $$cmd >/dev/null; \
320         find . -type d -name '*.junk' | xargs rm -fr
322 # Install HTML manuals in <htmldir>/<lang>/fmact/ subdirectory;
323 # where <htmldir> defaults to <pkgdocdir>/html
324 # Note: we do honor here --htmldir autotools configuration option.
325 # Manuals may be installed from builddir, if they just have been built,
326 # or from srcdir, if they were not built but come from distribution.
328 install-html-manuals:
329         @if test "x$(htmldir)" = "x$(docdir)"; then \
330                 _instd="$(DESTDIR)$(pkgdocdir)/html"; \
331         else \
332                 _instd="$(DESTDIR)$(htmldir)"; \
333         fi; \
334         echo "  Installing in $$_instd ..."; \
335         for lc in C $(DOC_LINGUAS); do \
336                 _instdir="$$_instd/$$lc/fmact"; \
337                 if test -f "$(builddir)/$$lc/$(DOC_MODULE).html"; then \
338                         d="$(builddir)"; \
339                 elif test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then \
340                         d="$(srcdir)"; \
341                 fi; \
342                 if test -f "$$d/$$lc/$(DOC_MODULE).html"; then \
343                         $(call install_html_doc,$$d,$$lc,$$_instdir); \
344                         $(call install_html_images,$$d,$$lc,$$_instdir,"stylesheet-images"); \
345                         $(call install_html_images,$$d,$$lc,$$_instdir,"admon"); \
346                         $(call install_html_figs,$$d,$$lc,$$_instdir); \
347                 fi; \
348         done
350 # installing html document
351 # 1: source dir
352 # 2: locale
353 # 3: target dir
354 install_html_doc = \
355         if test "$(opt_verbose)" = ""; then echo "    $(2)/fmact/$(DOC_MODULE).html"; fi; \
356         $(MKDIR_P) $(3); \
357         cp -p $(opt_verbose) "$(1)/$(2)/$(DOC_MODULE).html" $(3)/
359 # installing html images
360 # 1: source dir
361 # 2: locale
362 # 3: target dir
363 # 4: stylesheet-images or admon
364 install_html_images = \
365         if grep -lq $(4) "$(1)/$(2)/$(DOC_MODULE).html"; then \
366                 if test -d "$(1)/$(2)/$(4)"; then \
367                         if test "$(opt_verbose)" = ""; then echo "    $(2)/fmact/$(4)"; fi; \
368                         cmd="cp -rp $(opt_verbose) \"$(1)/$(2)/$(4)\" $(3)/"; eval $$cmd; \
369                         chmod -R u+w $(3); \
370                         if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
371                 fi; \
372         fi
374 # installing user's manual figures
375 # rebuilding list of figures here because I'm unable to pass it as a parameter
376 # (it comes here as a single string in which I cannot walk through)
377 # 1: source dir
378 # 2: locale
379 # 3: target dir
380 install_html_figs = \
381         if test "$(opt_verbose)" = ""; then echo "    $(2)/fmact/figures"; fi; \
382         figdir="$(3)/figures"; \
383         if ! test -d "$$figdir"; then $(MKDIR_P) "$$figdir"; fi; \
384         for fig in $(DOC_FIGURES); do \
385                 figsrc=$(srcdir)/$(2)/$$fig; \
386                 if test -f $${figsrc} -a ! -h $${figsrc}; then \
387                         cmd="$(INSTALL_DATA) $${figsrc} $${figdir}/"; \
388                 else \
389                         cmd="(cd $${figdir} && $(LN_S) -f ../../../C/fmact/$$fig)"; \
390                 fi; \
391                 if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
392                 eval $$cmd; \
393         done
395 uninstall-html-manuals:
396         @if test "x$(htmldir)" = "x$(docdir)"; then \
397                 _instdir="$(DESTDIR)$(pkgdocdir)/html"; \
398         else \
399                 _instdir="$(DESTDIR)$(htmldir)"; \
400         fi; \
401         if test -d $$_instdir; then \
402                 chmod -R u+w $$_instdir; \
403                 find $$_instdir -type d -name 'admon' | xargs rm -fr $(opt_verbose); \
404                 find $$_instdir -type d -name 'figures' | xargs rm -fr $(opt_verbose); \
405                 find $$_instdir -type d -name 'stylesheet-images' | xargs rm -fr $(opt_verbose); \
406                 find $$_instdir -type f -name '*.html' | xargs rm -f $(opt_verbose); \
407                 find $$_instdir -type d | sort -r | xargs rmdir $(opt_verbose); \
408         fi
410 # locale figures (_DOC_LC_FIGURES) are distributed by gnome-doc-utils
411 # when they exist
412 # - distribute admon/ or stylesheet-images/ icons
413 # - distribute *.html manuals
415 html-manuals-dist-hook:
416         @for lc in C $(DOC_LINGUAS); do \
417                 if test -f "$(builddir)/$$lc/$(DOC_MODULE).html"; then d=$(builddir); \
418                 elif test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then d=$(srcdir); fi; \
419                 if test -f "$$d/$$lc/$(DOC_MODULE).html"; then \
420                         if test "$(opt_verbose)" = ""; then echo "  Distributing $$lc/$(DOC_MODULE).html"; fi; \
421                         cmd="cp $(opt_verbose) $$d/$$lc/$(DOC_MODULE).html $(distdir)/$$lc/"; eval $$cmd; \
422                         $(call dist_html_images,$$d,$$lc,"stylesheet-images"); \
423                         $(call dist_html_images,$$d,$$lc,"admon"); \
424                 fi; \
425         done
427 # distribute html images
428 # 1. source dir
429 # 2. locale
430 # 3. image type (stylesheet-images or admon)
431 dist_html_images = \
432         if grep -lq $(3) "$(1)/$(2)/$(DOC_MODULE).html"; then \
433                 if test -d "$(1)/$(2)/$(3)"; then \
434                         if test "$(opt_verbose)" = ""; then echo "  Distributing $(2)/$(3)"; fi; \
435                         cmd="cp -rp $(opt_verbose) \"$(1)/$(2)/$(3)\" $(distdir)/$(2)/"; eval $$cmd; \
436                 fi; \
437         fi
439 # Build pdf manuals as $(srcdir)/<lang>/<module>.pdf
441 # The rule here is: only rebuild .pdf files if corresponding xml has changed
442 # .xml themselves are distributed, so are not modified when compiling from a
443 # distribution
445 # We only use dblatex for now
447 MANUALS_PDF = $(MANUALS_XML:%.xml=%.pdf)
449 MAINTAINERCLEANFILES += $(MANUALS_PDF)
451 if BUILD_PDF_MANUALS
452 all-pdf-manuals: $(MANUALS_PDF)
453 else
454 all-pdf-manuals:
455 endif
457 # workaround against l10n bug #664768
458 # pdflatex cannot generate some localized pdf
460 # As of dblatex 0.3.3:
461 # - always create the output pdf in the same directory that the
462 #   source xml
463 #   (but we need to cd $$lc to mkdir figures)
465 $(MANUALS_PDF): %.pdf: %.xml
466         @ftarget=$@; \
467         if test "$(opt_verbose)" = ""; then echo "  PDF    $$ftarget building..."; fi; \
468         lc=$${ftarget%/*}; \
469         list='$(DOC_FIGURES)'; \
470         (cd $$lc; \
471          $(MKDIR_P) figures; \
472          for fig in $$list; do \
473                 if test -f "$(srcdir)/$$lc/$$fig"; then d=$$lc; else d="C"; fi; \
474                 cmd="(cd figures && $(LN_S) -f $(srcdir)/$$d/$$fig)"; eval $$cmd; \
475          done; \
476          cmd="dblatex $(DOC_MODULE).xml"; eval $$cmd >/dev/null; \
477          if ! test -f $(DOC_MODULE).pdf; then \
478                 echo "  PDF    $$ftarget recovering from dblatex error..."; \
479                 tmpdir=`dblatex -d $(DOC_MODULE).xml 2>&1 | grep 'not removed' | awk '{ print $$1 }'`; \
480                 cp $$tmpdir/$(DOC_MODULE).pdf . || :; \
481                 rm -fr $$tmpdir; \
482          fi; \
483          for fig in $$list; do \
484                 if test -h figures/$$fig; then rm -f figures/$$fig; fi; \
485          done; \
486         ); \
487         if test "$(opt_verbose)" = ""; then \
488                 if test -f $$lc/$(DOC_MODULE).pdf; then \
489                         echo "  PDF    $$ftarget done"; \
490                 else \
491                         echo "  PDF    unable to build $$ftarget"; \
492                 fi; \
493         fi
495 # if --pdfdir has not been specified, then we default to PKGDOCDIR/pdf
496 # in all case, we append the locale as a subdirectory level
498 # as pdf are monobloc documents, we do not create a per-document subdir
500 install-pdf-manuals:
501         @if test "$(pdfdir)" = "$(docdir)"; then \
502                 _instdir=$(DESTDIR)$(pkgdocdir)/pdf; \
503         else \
504                 _instdir=$(DESTDIR)$(pdfdir); \
505         fi; \
506         echo "  Installing in $$_instdir ... "; \
507         for lc in C $(DOC_LINGUAS); do \
508                 if test -f $(srcdir)/$$lc/$(DOC_MODULE).pdf; then d=$(srcdir); fi; \
509                 if test -f $(builddir)/$$lc/$(DOC_MODULE).pdf; then d=$(builddir); fi; \
510                 if test -f $$d/$$lc/$(DOC_MODULE).pdf; then \
511                         if test "$(opt_verbose)" = ""; then echo "    $$lc/$(DOC_MODULE).pdf"; fi; \
512                         if ! test -d $$_instdir/$$lc; then cmd="$(MKDIR_P) $$_instdir/$$lc"; eval $$cmd; fi; \
513                         cmd="$(INSTALL_DATA) \"$$d/$$lc/$(DOC_MODULE).pdf\" \"$$_instdir/$$lc/\""; eval $$cmd; \
514                         if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
515                 fi; \
516         done
518 uninstall-pdf-manuals:
519         @if test "$(pdfdir)" = "$(docdir)"; then \
520                 _instdir=$(DESTDIR)$(pkgdocdir)/pdf; \
521         else \
522                 _instdir=$(DESTDIR)$(pdfdir); \
523         fi; \
524         if test -d $$_instdir; then \
525                 chmod -R u+w $$_instdir; \
526                 find $$_instdir -name '*.pdf' | xargs rm -f $(opt_verbose); \
527                 find $$_instdir -type d | sort -r | xargs rmdir $(opt_verbose); \
528         fi
530 pdf-manuals-dist-hook:
531         @for lc in C $(DOC_LINGUAS); do \
532                 if test -f $(builddir)/$$lc/$(DOC_MODULE).pdf; then d=$(builddir); \
533                 elif test -f $(srcdir)/$$lc/$(DOC_MODULE).pdf; then d=$(srcdir); fi; \
534                 if test -f "$$d/$$lc/$(DOC_MODULE).pdf"; then \
535                         if test "$(opt_verbose)" = ""; then echo "  Distributing $$lc/$(DOC_MODULE).pdf"; fi; \
536                         cmd="cp $$d/$$lc/$(DOC_MODULE).pdf $(distdir)/$$lc/"; eval $$cmd; \
537                         if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
538                 fi; \
539         done
541 # According to GNU Make manual (ยง 13 What Gets Cleaned):
543 # - mostlyclean deletes files we typically want to rebuild
544 # - clean deletes other files built with make
545 # - distclean deletes files built by configure (none here)
547 ##  None of these target should delete any distributed file
549 # - maintainer-clean should delete other files
550 clean-local: remove-C-xml
551         rm -f *~
552         rm -f *.stamp
553         for lc in C $(DOC_LINGUAS); do \
554           (cd $$lc; \
555            find figures -type l | xargs rm -f; \
556            rmdir figures 2>/dev/null || :; \
557           ); \
558         done
560 distclean-local: distclean-html distclean-pdf
562 distclean-html:
564 distclean-pdf:
566 maintainer-clean-local: maintainer-clean-html maintainer-clean-pdf
568 maintainer-clean-html:
569         find $(srcdir) -type d -name 'admon' | xargs rm -fr
570         find $(builddir) -type l -name 'admon' | xargs rm -f
571         find $(srcdir) -type d -name 'stylesheet-images' | xargs rm -fr
572         find $(builddir) -type d -name 'stylesheet-images' | xargs rm -fr
574 maintainer-clean-pdf:
576 # we have to override gnome-doc-utils.make:clean-doc-dir recipe
577 # as it tries to remove directories which are not empty as we have
578 # not yet deleted the files we putted on
579 clean-doc-dir:
580         @:
582 .PHONY: \
583         all-manuals install-manuals uninstall-manuals dist-manuals-hook \
584         all-html-manuals install-html-manuals uninstall-html-manuals dist-html-manuals-hook \
585         all-pdf-manuals install-pdf-manuals uninstall-pdf-manuals dist-pdf-manuals-hook