[nautilus-actions] Fix user's manual generation and distribution



commit c2e6791fa62f71e14b6de7a8be51670961a64096
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Dec 4 15:18:59 2011 +0100

    Fix user's manual generation and distribution

 ChangeLog             |    2 +
 docs/nact/Makefile.am |  294 +++++++++++++++++++++++++++----------------------
 2 files changed, 163 insertions(+), 133 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0dd4448..a803f82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-12-04 Pierre Wieser <pwieser trychlos org>
 
+	* docs/nact/Makefile.am: Fix User's Manual generation.
+
 	* docs/reference/nautilus-actions-docs.xml: API only changes on minor versions.
 
 	* run-autogen.sh: Do not automatically make && make install after configure.
diff --git a/docs/nact/Makefile.am b/docs/nact/Makefile.am
index a79cc2d..cd387fb 100644
--- a/docs/nact/Makefile.am
+++ b/docs/nact/Makefile.am
@@ -29,10 +29,6 @@
 # from Migrating your documentation to gnome-doc-utils
 # http://live.gnome.org/GnomeDocUtilsMigrationHowTo
 #
-# do not use the $(NULL) syntax here as this may prevent Damned-Lies
-# to correctly generate POT files (cf. mail of Claude Paroz 2010-08-29
-# http://mail.gnome.org/archives/gnome-i18n/2010-August/msg00229.html).
-#
 # This produces the Nautilus-Actions Configuration Tool (NACT) Users's Manual.
 # As a user's manual, it may be translated.
 # Default is to produce DocBook XML documents, suitable for Yelp, the
@@ -53,6 +49,10 @@
 # of the Gnome (i.e. gui) applications, and that we are using here to
 # generate html and pdf NACT user's manuals, with gtk-doc which rather
 # targets the developer documentation (see docs/reference).
+#
+# Note 1. Do not use the $(NULL) syntax here as this may prevent Damned-Lies
+# to correctly generate POT files (cf. mail of Claude Paroz 2010-08-29
+# http://mail.gnome.org/archives/gnome-i18n/2010-August/msg00229.html).
 
 if ENABLE_MANUALS
 
@@ -80,25 +80,22 @@ MAINTAINERCLEANFILES =
 
 pkgdocdir = $(datarootdir)/doc/@PACKAGE -@VERSION@
 
-all-local: all-manuals all-html-manuals all-pdf-manuals
+# set to '-v' to be verbose (much verbose!)
+opt_verbose =
 
-.PHONY: \
-	all-manuals install-manuals uninstall-manuals dist-manuals-hook \
-	all-html-manuals install-html-manuals install-html-figs install-html-admon \
-	uninstall-html-manuals dist-html-manuals-hook dist-html-admon dist-html-doc \
-	distclean-html maintainer-clean-html \
-	all-pdf-manuals install-pdf-manuals \
-	uninstall-pdf-manuals dist-pdf-manuals-hook \
-	distclean-pdf maintainer-clean-pdf
+all-local: all-manuals all-html-manuals all-pdf-manuals
 
+.PHONY: all-manuals
 all-manuals: all-html-manuals all-pdf-manuals
 
 install-data-local: install-manuals
 
+.PHONY: install-manuals
 install-manuals: install-html-manuals install-pdf-manuals
 
 uninstall-local: uninstall-manuals
 
+.PHONY: uninstall-manuals
 uninstall-manuals: uninstall-html-manuals uninstall-pdf-manuals
 
 # doc-dist-hook is the dist hook from gnome-doc-utils.make
@@ -107,6 +104,7 @@ uninstall-manuals: uninstall-html-manuals uninstall-pdf-manuals
 # the distributed .omf.in file
 dist-hook: doc-dist-hook dist-manuals-hook
 
+.PHONY: dist-manuals-hook
 dist-manuals-hook: dist-html-manuals-hook dist-pdf-manuals-hook
 
 # Build HTML manuals as $(srcdir)/<lang>/<module>.html
@@ -144,6 +142,8 @@ MANUALS_HTML = $(MANUALS_XML:%.xml=%.html)
 
 MAINTAINERCLEANFILES += $(MANUALS_HTML)
 
+.PHONY: all-html-manuals
+
 if ENABLE_HTML_MANUALS
 all-html-manuals: $(MANUALS_HTML)
 else
@@ -155,11 +155,11 @@ endif
 #
 # The rule here is: only rebuild html/ files if corresponding xml has changed
 # .xml themselves are distributed, so are not modified when compiling from a
-# distribution
+# distribution (though this is not the intended use).
 #
-# current=/home/pierre/data/eclipse/nautilus-actions/nautilus-actions-3.1.5/_build/docs/nact
-# srcdir=../../../docs/nact
-# top_srcdir=../../..
+# pwd=/home/pierre/data/eclipse/nautilus-actions/nautilus-actions-3.1.5/_build/docs/nact
+# target=C/nautilus-actions-config-tool.html
+# source=/home/pierre/net/eclipse/nautilus-actions/docs/nact/C/nautilus-actions-config-tool.xml
 #
 # db2html 0.6.14 bugs and work-arounds:
 # - '*.junk' and 'docbook2html-dir/' are subdirectories left by db2html when
@@ -173,59 +173,99 @@ endif
 #   (see https://bugzilla.gnome.org/show_bug.cgi?id=664784)
 
 $(MANUALS_HTML): %.html: %.xml
-	@echo "Generating $@ ..."; \
-	lc=$<; lc=$${lc%/*}; \
-	if test "x$(WITH_DB2HTML)" = "xyes"; then \
-		cmd="db2html --output $$lc --nochunks $<"; echo "$$cmd"; (eval $$cmd); \
-	    (cd $$lc; mv -v $(DOC_MODULE)/stylesheet-images .; rmdir -v $(DOC_MODULE)); \
+	@if test "$(opt_verbose)" = ""; then echo "  HTML   $@"; fi; \
+	( \
+	 dirxml=$<; dirxml=$${dirxml%/*}; cd $$dirxml; \
+	 fxml=$<; fxml=$${fxml##*/}; \
+	 if test "x$(WITH_DB2HTML)" = "xyes"; then \
+		cmd="db2html --output . --nochunks $$fxml"; \
+		if test "$(opt_verbose)" != ""; then echo "$$cmd"; fi; \
+		eval $$cmd || :; \
+		rm -fr stylesheet-images; \
+	    mv $(opt_verbose) $(DOC_MODULE)/stylesheet-images .; rmdir $(opt_verbose) $(DOC_MODULE); \
 	    find . -type d -name '*.junk' | xargs rm -fr; \
 	    find . -type d -name 'docbook2html-dir' | xargs rm -fr; \
-	fi; \
-	if test "x$(WITH_GDT)" = "xyes"; then \
-		(cd $$lc; \
+	 fi; \
+	 if test "x$(WITH_GDT)" = "xyes"; then \
 		 fhtml=$@; fhtml=$${fhtml##*/}; \
-		 fxml=$<; fxml=$${fxml##*/}; \
-		 cmd="gnome-doc-tool html -o . -d0 $$fxml"; echo "$$cmd"; (eval $$cmd); \
-		 sed -i -e 's?url("admon?url("admon/admon?' $$fhtml; \
-		); \
-	fi
+		 cmd="gnome-doc-tool html -o . -d0 $$fxml"; \
+		 if test "$(opt_verbose)" != ""; then echo "$$cmd"; fi; \
+		 eval $$cmd; \
+		 if test -f $$fhtml; then \
+			 sed -i -e 's?url("admon?url("admon/admon?' $$fhtml; \
+			 admon_dir=/usr/share/gnome-doc-utils/icons/hicolor/48x48/status; \
+			 if test -d $$admon_dir; then \
+				lc=$${dirxml##*/}; \
+				if test "$$lc" = "C"; then \
+					cmd="$(mkinstalldirs) admon"; eval $$cmd; \
+					cmd="cp $(opt_verbose) $$admon_dir/*.png admon/"; eval $$cmd; \
+				else \
+					cmd="$(LN_S) -f ../C/admon)"; eval $$cmd; \
+					if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
+				fi; \
+			fi; \
+		fi; \
+	 fi; \
+	)
 
-# Install HTML manuals if they exist (do not try to rebuild them)
+# Install HTML manuals
 # in <htmldir>/<lang>/nact/ subdirectory; htmldir defaulting
 # to <pkgdocdir>/html
 #
-# Note that we do honor here --htmldir autotools configuration option.
+# Note: we do honor here --htmldir autotools configuration option.
+#
+# Note: workaround against the bug #636175 (do not install admon-* icons)
+# Install admon icons as a admon/ subdirectory for C language
+# other languages are symlinked to this one
 
-if ENABLE_HTML_MANUALS
-install-html-manuals: all-html-manuals install-html-figs install-html-admon
-	for lc in C $(_DOC_REAL_LINGUAS); do \
+.PHONY: install-html-manuals
+install-html-manuals: install-html-figs
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
 		if test "x$(htmldir)" = "x$(docdir)"; then \
 			_instdir="$(DESTDIR)$(pkgdocdir)/html/$$lc/nact"; \
 		else \
 			_instdir="$(DESTDIR)$(htmldir)/$$lc/nact"; \
 		fi; \
-		if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then \
-			cp -vp "$(srcdir)/$$lc/$(DOC_MODULE).html" $$_instdir/; \
-			if test -d "$(srcdir)/$$lc/stylesheet-images"; then \
-				cmd="cp -vrp \"$(srcdir)/$$lc/stylesheet-images\" $$_instdir/"; echo $$cmd; (eval $$cmd); \
+		if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then d=$(srcdir); fi; \
+		if test -f "$(builddir)/$$lc/$(DOC_MODULE).html"; then d=$(builddir); fi; \
+		if test -f "$$d/$$lc/$(DOC_MODULE).html"; then \
+			if test "$(opt_verbose)" = ""; then echo "  Installing $$_instdir/$(DOC_MODULE).html ..."; fi; \
+			cp -p $(opt_verbose) "$$d/$$lc/$(DOC_MODULE).html" $$_instdir/; \
+			subdir="stylesheet-images"; \
+			if test -d "$$d/$$lc/$$subdir"; then \
+				if test "$(opt_verbose)" = ""; then echo "  Installing $$_instdir/$$subdir ..."; fi; \
+				cmd="cp -rp $(opt_verbose) \"$$d/$$lc/$$subdir\" $$_instdir/"; eval $$cmd; \
+				if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
+			fi; \
+			subdir="admon"; \
+			if test -d "$$d/$$lc/$$subdir"; then \
+				if test "$(opt_verbose)" = ""; then echo "  Installing $$_instdir/$$subdir ..."; fi; \
+				cmd="cp -rp $(opt_verbose) \"$$d/$$lc/$$subdir\" $$_instdir/"; eval $$cmd; \
+				if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
+			fi; \
+			if test -h "$$d/$$lc/$$subdir"; then \
+				if test "$(opt_verbose)" = ""; then echo "  Installing $$_instdir/$$subdir ..."; fi; \
+				cmd="(cd \"$$_instdir/$$lc/nact\"; $(LN_S) -f ../../C/nact/$$subdir)"; eval $$cmd; \
+				if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
 			fi; \
 		fi; \
 	done
-else
-install-html-manuals:
-endif
 
 # copied from gnome-doc-utils.make install-doc-figs target
 # modified to install the figures with html manuals
+.PHONY: install-html-figs
 install-html-figs:
-	if test "x$(htmldir)" = "x$(docdir)"; then \
+	@if test "x$(htmldir)" = "x$(docdir)"; then \
 		_instdir="$(DESTDIR)$(pkgdocdir)/html"; \
 	else \
 		_instdir="$(DESTDIR)$(htmldir)"; \
 	fi; \
 	list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; \
 	for lc in C $(_DOC_REAL_LINGUAS); do \
-	  if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then \
+	  if test "$(opt_verbose)" = ""; then echo "  Installing $$_instdir/$$lc/nact/figures ..."; fi; \
+	  if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then d=$(srcdir); fi; \
+	  if test -f "$(builddir)/$$lc/$(DOC_MODULE).html"; then d=$(builddir); fi; \
+	  if test -f "$$d/$$lc/$(DOC_MODULE).html"; then \
 		for fig in $$list; do \
 			figsymlink=false; \
 			if test -f "$(srcdir)/$$lc/$$fig" -a ! -h "$(srcdir)/$$lc/$$fig"; then \
@@ -233,82 +273,52 @@ install-html-figs:
 			else \
 				figsymlink=true; \
 			fi; \
-			figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
-			figdir="$$_instdir/$$lc/nact/$$figdir"; \
-			if ! test -d "$$figdir"; then cmd="$(mkinstalldirs) $$figdir"; echo $$cmd; (eval $$cmd); fi; \
+			figdir="$$_instdir/$$lc/nact/$${fig%/*}"; \
+			if ! test -d "$$figdir"; then cmd="$(MKDIR_P) $$figdir"; eval $$cmd; fi; \
 			if $$figsymlink; then \
-				cmd="cd $$figdir && $(LN_S) -f ../../../C/nact/$$fig"; \
+				cmd="(cd $$figdir && $(LN_S) -f ../../../C/nact/$$fig)"; \
 			else \
 				cmd="$(INSTALL_DATA) $$figfile $$figdir/"; \
 			fi; \
-			echo $$cmd; (eval $$cmd); \
+			if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
+			eval $$cmd; \
 		done; \
 	  fi; \
 	done
 
-# A workaround against the bug #636175 (do not install admon-* icons)
-# Install admon icons as a admon/ subdirectory for C language
-# other languages are symlinked to this one
-install-html-admon:
-	admon_dir=/usr/share/gnome-doc-utils/icons/hicolor/48x48/status; \
-	if test -d $$admon_dir; then \
-		admon_src=$$admon_dir; \
-	else \
-		admon_src=$(srcdir)/C/admon; \
-	fi; \
-	echo "admon_src=$$admon_src"; \
-	if test -d "$$admon_src"; then \
-		if test "x$(htmldir)" = "x$(docdir)"; then \
-			_instdir="$(DESTDIR)$(pkgdocdir)/html"; \
-		else \
-			_instdir="$(DESTDIR)$(htmldir)"; \
-		fi; \
-		if test -f "$(srcdir)/C/$(DOC_MODULE).html"; then \
-			cmd="$(mkinstalldirs) \"$$_instdir/C/nact/admon\""; echo $$cmd; (eval $$cmd); \
-			cmd="cp -v $$admon_src/*.png \"$$_instdir/C/nact/admon/\""; echo $$cmd; (eval $$cmd); \
-			for lc in $(_DOC_REAL_LINGUAS); do \
-				if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then \
-					cmd="cd \"$$_instdir/$$lc/nact\"; $(LN_S) -f ../../C/nact/admon"; echo $$cmd; (eval $$cmd); \
-				fi; \
-			done; \
-		fi; \
-	fi
-
+.PHONY: uninstall-html-manuals
 uninstall-html-manuals:
-	if test "x$(htmldir)" = "x$(docdir)"; then \
+	@if test "x$(htmldir)" = "x$(docdir)"; then \
 		_instdir="$(DESTDIR)$(pkgdocdir)/html"; \
 	else \
 		_instdir="$(DESTDIR)$(htmldir)"; \
 	fi; \
-	find $$_instdir -type d -name 'admon' | xargs rm -vfr; \
-	find $$_instdir -type l -name 'admon' | xargs rm -vf; \
-	find $$_instdir -type d -name 'figures' | xargs rm -vfr; \
-	find $$_instdir -type d -name 'stylesheet-images' | xargs rm -vfr; \
-	find $$_instdir -type f -name '*.html' | xargs rm -vf; \
-	find $$_instdir -type d | sort -r | xargs rmdir -v
+	find $$_instdir -type d -name 'admon' | xargs rm -fr $(opt_verbose); \
+	find $$_instdir -type l -name 'admon' | xargs rm -f $(opt_verbose); \
+	find $$_instdir -type d -name 'figures' | xargs rm -fr $(opt_verbose); \
+	find $$_instdir -type d -name 'stylesheet-images' | xargs rm -fr $(opt_verbose); \
+	find $$_instdir -type f -name '*.html' | xargs rm -f $(opt_verbose); \
+	find $$_instdir -type d | sort -r | xargs rmdir $(opt_verbose)
 
 # locale figures (_DOC_LC_FIGURES) are distributed by gnome-doc-utils
 # when they exist
 # - distribute admon-* icons as a C/ subdirectory
 # - distribute *.html manuals
-# This obviously suppose that gnome-doc-utils package is installed
-dist-html-manuals-hook: all-html-manuals dist-html-admon dist-html-doc
-
-dist-html-admon:
-	admon_dir=/usr/share/gnome-doc-utils/icons/hicolor/48x48/status; \
-	if test -d $$admon_dir; then \
-		if test -f $(srcdir)/C/$(DOC_MODULE).html; then \
-			cmd="$(mkinstalldirs) \"$(distdir)/C/admon\""; echo $$cmd; (eval $$cmd); \
-			cmd="cp -vp $$admon_dir/*.png $(distdir)/C/admon/"; echo $$cmd; (eval $$cmd); \
-		fi; \
-	fi
 
-dist-html-doc:
-	for lc in C $(_DOC_REAL_LINGUAS); do \
-		if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then \
-			cmd="cp $(srcdir)/$$lc/$(DOC_MODULE).html $(distdir)/$$lc/"; echo $$cmd; (eval $$cmd); \
-			if test -d "$(srcdir)/$$lc/stylesheet-images"; then \
-				cmd="cp -vrp \"$(srcdir)/$$lc/stylesheet-images\" $(distdir)/$$lc/"; echo $$cmd; (eval $$cmd); \
+.PHONY: dist-html-manuals-hook
+dist-html-manuals-hook:
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+		if test -f "$(srcdir)/$$lc/$(DOC_MODULE).html"; then d=$(srcdir); fi; \
+		if test -f "$(builddir)/$$lc/$(DOC_MODULE).html"; then d=$(builddir); fi; \
+		if test -f "$$d/$$lc/$(DOC_MODULE).html"; then \
+			cmd="cp $(opt_verbose) $$d/$$lc/$(DOC_MODULE).html $(distdir)/$$lc/"; eval $$cmd; \
+			if test -d "$$d/$$lc/stylesheet-images"; then \
+				echo "distributing stylesheet-images"; \
+				cmd="cp -rp $(opt_verbose) \"$$d/$$lc/stylesheet-images\" $(distdir)/$$lc/"; eval $$cmd; \
+			fi; \
+			if test -d "$$d/$$lc/admon" -o -h "$$d/$$lc/admon"; then \
+				echo "distributing admon"; \
+				cmd="cp -rp $(opt_verbose) \"$$d/$$lc/admon\" $(distdir)/$$lc/"; eval $$cmd; \
 			fi; \
 		fi; \
 	done
@@ -325,6 +335,8 @@ MANUALS_PDF = $(MANUALS_XML:%.xml=%.pdf)
 
 MAINTAINERCLEANFILES += $(MANUALS_PDF)
 
+.PHONY: all-pdf-manuals
+
 if ENABLE_PDF_MANUALS
 all-pdf-manuals: $(MANUALS_PDF)
 else
@@ -335,55 +347,66 @@ endif
 # we so are sure that they exist and are up to date
 # (path is .po ->[msgfmt]-> .mo ->[xml2po]-> .xml)
 $(MANUALS_PDF): %.pdf: %.xml
-	@lc=$<; \
-	lc=$${lc%/*}; \
-	echo "Generating $@ ..."; \
-	if ! test -d "$$lc/figures"; then cmd="$(MKDIR_P) $$lc/figures"; (eval $$cmd); fi; \
-	list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; \
-	for fig in $$list; do \
-		if ! test -f "$$lc/$$fig"; then \
-			cmd="(cd $$lc/figures && $(LN_S) -f ../../$(srcdir)/C/$$fig)"; (eval $$cmd); \
+	@if test "$(opt_verbose)" = ""; then echo "  PDF    $@"; fi; \
+	( \
+	 dirxml=$<; dirxml=$${dirxml%/*}; cd $$dirxml; \
+	 fxml=$<; fxml=$${fxml##*/}; \
+	 lc=$@; \
+	 lc=$${lc%/*}; \
+	 $(MKDIR_P) figures; \
+	 list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; \
+	 for fig in $$list; do \
+		if test -f "$(srcdir)/$$lc/$$fig"; then d=$$lc; else d="C"; fi; \
+		if ! test -f $$fig; then \
+			cmd="(cd figures && $(LN_S) -f $(srcdir)/$$d/$$fig)"; eval $$cmd; \
 		fi; \
-	done; \
-	cmd="dblatex --output $@ $<"; echo $$cmd; (eval $$cmd); \
-	find $$lc/figures -type l | xargs rm -f; \
-	rmdir $$lc/figures 2>/dev/null || :
+	 done; \
+	 cmd="dblatex $$fxml"; eval $$cmd; \
+	 find figures -type l | xargs rm -f; \
+	 rmdir figures 2>/dev/null || :; \
+	)
 
 # if --pdfdir has not been specified, then we default to PKGDOCDIR/pdf
 # in all case, we append the locale as a subdirectory level
 #
 # as pdf are monobloc documents, we do not create a per-document subdir
 
-if ENABLE_PDF_MANUALS
-install-pdf-manuals: all-pdf-manuals
-	if test "$(pdfdir)" = "$(docdir)"; then \
+.PHONY: install-pdf-manuals
+install-pdf-manuals:
+	@if test "$(pdfdir)" = "$(docdir)"; then \
 		_instdir=$(DESTDIR)$(pkgdocdir)/pdf; \
 	else \
 		_instdir=$(DESTDIR)$(pdfdir); \
 	fi; \
 	for lc in C $(_DOC_REAL_LINGUAS); do \
-		if test -f $(srcdir)/$$lc/$(DOC_MODULE).pdf; then \
-			if ! test -d $$_instdir/$$lc; then cmd="$(MKDIR_P) $$_instdir/$$lc"; echo $$cmd; (eval $$cmd); fi; \
-			cmd="$(INSTALL_DATA) \"$(srcdir)/$$lc/$(DOC_MODULE).pdf\" \"$$_instdir/$$lc/\""; echo $$cmd; (eval $$cmd); \
+		if test -f $(srcdir)/$$lc/$(DOC_MODULE).pdf; then d=$(srcdir); fi; \
+		if test -f $(builddir)/$$lc/$(DOC_MODULE).pdf; then d=$(builddir); fi; \
+		if test -f $$d/$$lc/$(DOC_MODULE).pdf; then \
+			if test "$(opt_verbose)" = ""; then echo "  Installing $$_instdir/$$lc/$(DOC_MODULE).pdf ..."; fi; \
+			if ! test -d $$_instdir/$$lc; then cmd="$(MKDIR_P) $$_instdir/$$lc"; eval $$cmd; fi; \
+			cmd="$(INSTALL_DATA) \"$$d/$$lc/$(DOC_MODULE).pdf\" \"$$_instdir/$$lc/\""; eval $$cmd; \
+			if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
 		fi; \
 	done
-else
-install-pdf-manuals:
-endif
 
+.PHONY: uninstall-pdf-manuals
 uninstall-pdf-manuals:
-	if test "$(pdfdir)" = "$(docdir)"; then \
+	@if test "$(pdfdir)" = "$(docdir)"; then \
 		_instdir=$(DESTDIR)$(pkgdocdir)/pdf; \
 	else \
 		_instdir=$(DESTDIR)$(pdfdir); \
 	fi; \
-	find $$_instdir -name '*.pdf' | xargs rm -vf; \
-	find $$_instdir -type d | sort -r | xargs rmdir -v
+	find $$_instdir -name '*.pdf' | xargs rm -f $(opt_verbose); \
+	find $$_instdir -type d | sort -r | xargs rmdir $(opt_verbose)
 
+.PHONY: dist-pdf-manuals-hook
 dist-pdf-manuals-hook:
-	for lc in C $(_DOC_REAL_LINGUAS); do \
-		if test -f "$(srcdir)/$$lc/$(DOC_MODULE).pdf"; then \
-			cmd="cp $(srcdir)/$$lc/$(DOC_MODULE).pdf $(distdir)/$$lc/"; echo $$cmd; (eval $$cmd); \
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+		if test -f $(srcdir)/$$lc/$(DOC_MODULE).pdf; then d=$(srcdir); fi; \
+		if test -f $(builddir)/$$lc/$(DOC_MODULE).pdf; then d=$(builddir); fi; \
+		if test -f "$$d/$$lc/$(DOC_MODULE).pdf"; then \
+			cmd="cp $$d/$$lc/$(DOC_MODULE).pdf $(distdir)/$$lc/"; eval $$cmd; \
+			if test "$(opt_verbose)" != ""; then echo $$cmd; fi; \
 		fi; \
 	done
 
@@ -403,18 +426,23 @@ clean-local:
 distclean-local: distclean-html distclean-pdf
 
 distclean-html:
-	find $(srcdir) -type l -name 'admon' | xargs rm -vf; \
-	for d in `find $(srcdir) -type d -name 'figures'`; do find $$d -type l | xargs rm -vf; done
 
 distclean-pdf:
 
 maintainer-clean-local: maintainer-clean-html maintainer-clean-pdf
 
 maintainer-clean-html:
-	find $(srcdir) -type f -name 'admon/*.png' | xargs rm -vf; \
-	rmdir -v $(srcdir)/C/admon; \
-	find $(srcdir) -type d -name 'stylesheet-images' | xargs rm -vfr
+	find $(srcdir) -type d -name 'admon' | xargs rm -fr
+	find $(builddir) -type l -name 'admon' | xargs rm -f
+	find $(srcdir) -type d -name 'stylesheet-images' | xargs rm -fr
+	find $(builddir) -type d -name 'stylesheet-images' | xargs rm -fr
 
 maintainer-clean-pdf:
 
+# we have to override gnome-doc-utils.make:clean-doc-dir recipe
+# as it tries to remove directories which are not empty as we have
+# not yet deleted the files we putted on
+clean-doc-dir:
+	@:
+
 endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]