[gimp-help-2/gimp-help-2-6-2: 2/2] [make] Fix clean-up routines if builddir != srcdir



commit b98d268b3839a8c7d5fcfd462e51be6b5318a3ce
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Wed Apr 20 20:05:16 2011 +0200

    [make] Fix clean-up routines if builddir != srcdir
    
    The commands for removing stale files require builddir = srcdir.
    (Bug #648128 - see previous "make" commit; bug #648124 "... separate
    build directory" [not tested, there may be more bugs...])

 Makefile.am |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a6ae714..ba64713 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -451,11 +451,13 @@ AUTHORS_POT = $(AUTHORS_DOCBOOK_XML:src/%/$(AUTHORS_DOCBOOK_FILENAME)=pot/%.pot)
 # Remove left over pot files
 cleanup-pot:
        $(msg) "Cleaning up pot files ..."
-       $(cmd) $(find_l) pot/ $(pot_file_predicates) | \
-       while read potfile; do \
-               potfile=$${potfile#pot/}; srcfile=src/$${potfile%.pot}.xml \
-               test -e $${srcfile} || rm -f $${potfile}; \
-       done
+       $(cmd) if [ "$(srcdir)" = "$(builddir)" ]; then \
+               $(find_l) pot/ $(pot_file_predicates) | \
+               while read potfile; do \
+                       potfile=$${potfile#pot/}; srcfile=src/$${potfile%.pot}.xml \
+                       test -e $${srcfile} || rm -f $${potfile}; \
+               done; \
+       fi
 
 # Targets suitable for command line
 pot: potfiles cleanup-pot ;
@@ -481,12 +483,14 @@ potfiles: $(POT_FILES) ;
 # HIDE FROM AUTOMAKE #po-$(1): $$($(1)_PO_FILES) cleanup-po-$(1)
 # HIDE FROM AUTOMAKE # $$(cmd) if test -e messages.mo; then rm -f messages.mo; fi
 # HIDE FROM AUTOMAKE #cleanup-po-$(1):
+# HIDE FROM AUTOMAKE #ifeq ($$(srcdir),$$(builddir))
 # HIDE FROM AUTOMAKE # $$(msg) "Cleaning up '$(1)' po files ..."
 # HIDE FROM AUTOMAKE # $$(cmd) $(find_l) po/$(1)/ $$(po_file_predicates) | \
 # HIDE FROM AUTOMAKE # while read pofile; do \
 # HIDE FROM AUTOMAKE #         potfile=pot/$$$${pofile#po/$(1)/}t; \
 # HIDE FROM AUTOMAKE #         test -e $$$${potfile} || rm -vf $$$${pofile}; \
 # HIDE FROM AUTOMAKE # done
+# HIDE FROM AUTOMAKE #endif
 # HIDE FROM AUTOMAKE #endef
 
 $(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_PO_RULES,$(LANG))))
@@ -629,10 +633,12 @@ xml/%/images: $(IMAGE_PREREQ)
 # Remove left over xml files
 cleanup-xml-%:
        $(msg) "Cleaning up '$*' xml files ..."
-       $(cmd) $(find_l) xml/$*/ $(xml_file_predicates) | \
-       while read xmlfile; do \
-               test -e src/$${xmlfile#xml/$*/} || rm -vf $${xmlfile}; \
-       done
+       $(cmd) if [ "$(srcdir)" = "$(builddir)" ]; then \
+               $(find_l) xml/$*/ $(xml_file_predicates) | \
+               while read xmlfile; do \
+                       test -e src/$${xmlfile#xml/$*/} || rm -vf $${xmlfile}; \
+               done; \
+       fi
 
 # Target suitable for command line
 images-%: xml/%/images html/%/images ;


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