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