[Xfce4-commits] <xfce4-panel:master> Improve manual Makefile.

Nick Schermer noreply at xfce.org
Sun Mar 14 12:12:01 CET 2010


Updating branch refs/heads/master
         to 28119481f5942aa5b20ab8526699036059f7f173 (commit)
       from 2791f72621e082b515f7a49a09cfec56ff599c00 (commit)

commit 28119481f5942aa5b20ab8526699036059f7f173
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Mar 14 11:44:26 2010 +0100

    Improve manual Makefile.
    
    Add some better checks and quote all filenames.

 docs/manual/Makefile.am |   83 +++++++++++++++++++++++++----------------------
 1 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/docs/manual/Makefile.am b/docs/manual/Makefile.am
index bbe35b0..117d8f4 100644
--- a/docs/manual/Makefile.am
+++ b/docs/manual/Makefile.am
@@ -26,76 +26,81 @@ ALL_LINGUAS = C $(LINGUAS)
 
 # install the html files to the destdir
 install-data-local:
-	file=$(srcdir)/html/$(PACKAGE).css; \
-	if test -f $$file; then \
-		dest=$(DESTDIR)$(docdir)/html; \
-		$(mkinstalldirs) $$dest; \
-		$(INSTALL_DATA) $$file $$dest/; \
+	file="$(srcdir)/html/$(PACKAGE).css"; \
+	if test -f "$$file"; then \
+		dest="$(DESTDIR)$(docdir)/html"; \
+		$(mkinstalldirs) "$$dest"; \
+		$(INSTALL_DATA) "$$file" "$$dest/"; \
 	fi; \
 	for lang in $(ALL_LINGUAS); do \
-		if test -d $(srcdir)/html/$$lang; then \
-			dest=$(DESTDIR)$(docdir)/html/$$lang; \
-			$(mkinstalldirs) $$dest; \
-			installfiles=`echo $(srcdir)/html/$$lang/*`; \
+		if test -d "$(srcdir)/html/$$lang"; then \
+			dest="$(DESTDIR)$(docdir)/html/$$lang"; \
+			$(mkinstalldirs) "$$dest"; \
+			installfiles=`echo "$(srcdir)/html/$$lang/*"`; \
 			for file in $$installfiles; do \
-				echo "--- Installing "$$file; \
-				$(INSTALL_DATA) $$file $$dest/; \
+				echo "--- Installing $$file"; \
+				$(INSTALL_DATA) "$$file" "$$dest/"; \
 			done; \
 		fi \
 	done
 
 # remove installed files from the destdir
 uninstall-local:
-	file=$(DESTDIR)$(docdir)/html/$(PACKAGE).css; \
-	if test -f $$file; then \
-		rm -f $$file; \
+	file="$(DESTDIR)$(docdir)/html/$(PACKAGE).css"; \
+	if test -f "$$file"; then \
+		rm -f "$$file"; \
 	fi; \
 	for lang in $(ALL_LINGUAS); do \
-		dest=$(DESTDIR)$(docdir)/html/$$lang; \
-		if test -d $$dest; then \
+		dest="$(DESTDIR)$(docdir)/html/$$lang"; \
+		if test -d "$$dest"; then \
 			rm -f $$dest/*.html; \
 		fi \
 	done;
 
 # remove generate html from the srcdir
 clean-local:
-	rm -rf $(srcdir)/html
+	rm -rf "$(srcdir)/html"
 
 if GENERATE_DOCUMENTATION
 
 # regenerate po(t) files
 update-po:
-	rm -f $(srcdir)/po/$(GETTEXT_PACKAGE).pot; \
-	$(XML2PO) -o $(srcdir)/po/$(GETTEXT_PACKAGE).pot $(MALLARD_PAGES); \
+	rm -f "$(srcdir)/po/$(GETTEXT_PACKAGE).pot"; \
+	$(XML2PO) -o "$(srcdir)/po/$(GETTEXT_PACKAGE).pot" $(MALLARD_PAGES); \
 	for lang in $(LINGUAS); do \
-		$(XML2PO) -u $(srcdir)/po/$$lang.po $(MALLARD_PAGES);
+		$(XML2PO) -u "$(srcdir)/po/$$lang.po" $(MALLARD_PAGES);
 	done
 
 # build the translated help files
 doc-build.stamp:
-	@chmod -R u+w $(srcdir); \
-	rm -rf $(srcdir)/html $(srcdir)/.pages; \
+	@chmod -R u+w "$(srcdir)"; \
+	rm -rf "$(srcdir)/html $(srcdir)/.pages"; \
 	echo; \
 	echo "Creating CSS file for documentation"; \
 	$(GNOME_DOC_TOOL) css -o "$(srcdir)/html/$(PACKAGE).css"; \
 	echo; \
 	for lang in $(ALL_LINGUAS); do \
 		echo "Generating $$lang documentation"; \
-		mkdir -p $(srcdir)/.pages; \
+		mkdir -p "$(srcdir)/.pages/"; \
 		if test x"$$lang" = x"C"; then \
-			cp $(MALLARD_PAGES) .pages/; \
+			for page in $(MALLARD_PAGES); do \
+				cp -t "$(srcdir)/.pages/" "$(srcdir)/$$page"; \
+			done; \
 		else \
 			echo "  - Creating translated pages"; \
-			pofile=$(srcdir)/po/$$lang.po; \
+			pofile="$(srcdir)/po/$$lang.po"; \
 			for page in $(MALLARD_PAGES); do \
-				$(XML2PO) -l $$lang -p "$$pofile" -o "$(srcdir)/.pages/$$page" "$(srcdir)/$$page"; \
+				$(XML2PO) -l "$$lang" -p "$$pofile" -o "$(srcdir)/.pages/$$page" "$(srcdir)/$$page"; \
 			done; \
 		fi; \
-		echo "  - Building HTML files"; \
-		$(GNOME_DOC_TOOL) html -n -c "../$(PACKAGE).css" -o "$(srcdir)/html/$$lang/" "$(srcdir)/.pages/"; \
-		chmod -R u+w $(srcdir)/html/$$lang; \
-		rm -rf $(srcdir)/.pages; \
-		rm -rf $(srcdir)/html/$$lang/*.cache; \
+		if test -f "$(srcdir)/.pages/index.page"; then \
+			echo "  - Building HTML files"; \
+			$(GNOME_DOC_TOOL) html -n -c "../$(PACKAGE).css" -o "$(srcdir)/html/$$lang/" "$(srcdir)/.pages/"; \
+			chmod -R u+w "$(srcdir)/html/$$lang"; \
+		else \
+			echo "  - No mallard pages found, skipping HTML generation!"; \
+		fi; \
+		rm -rf "$(srcdir)/.pages" "$(srcdir)/html/$$lang/index.cache"; \
 		echo; \
 	done; \
 	touch doc-build.stamp
@@ -109,7 +114,7 @@ update-po:
 	@false
 
 doc-build.stamp:
-	@if test ! -d $(srcdir)/html -a ! -d $(srcdir)/man; then \
+	@if test ! -d "$(srcdir)/html"; then \
 		echo; \
 		echo "*** No generated documentation found. If you want to"; \
 		echo "*** generate the (translated) documentation, run configure"; \
@@ -129,15 +134,15 @@ all: doc-build.stamp
 
 # include the css and html files in the dist
 dist-hook: dist-check-doc doc-build.stamp
-	file=$(srcdir)/html/$(PACKAGE).css; \
-	if test -f $$file; then \
-		mkdir -p $(distdir)/html; \
-		cp $$file $(distdir)/html/; \
+	file="$(srcdir)/html/$(PACKAGE).css"; \
+	if test -f "$$file"; then \
+		mkdir -p "$(distdir)/html"; \
+		cp "$$file" "$(distdir)/html/"; \
 	fi; \
 	for lang in $(ALL_LINGUAS); do \
-		if test -d $(srcdir)/html/$$lang; then \
-			mkdir -p $(distdir)/html/$$lang; \
-			cp $(srcdir)/html/$$lang/* $(distdir)/html/$$lang/; \
+		if test -d "$(srcdir)/html/$$lang"; then \
+			mkdir -p "$(distdir)/html/$$lang"; \
+			cp -t "$(distdir)/html/$$lang/" $(srcdir)/html/$$lang/*; \
 		fi \
 	done
 



More information about the Xfce4-commits mailing list