bug 525221 - Loop over DIRS better. Patch by Benjamin Smedberg <benjamin@smedbergs.us>, r=me
authorted.mielczarek%gmail.com
Wed, 11 Nov 2009 11:46:38 +0000
changeset 4181 00d209f0b97bab185b42d1ca801fb407591b7e33
parent 4180 d12a2d912eea95756965f6bc0d3eb94a72c692aa
child 4182 e41aee7c82d43af6399e0fd86d27e51c89bba81c
push idunknown
push userunknown
push dateunknown
reviewersme
bugs525221
bug 525221 - Loop over DIRS better. Patch by Benjamin Smedberg <benjamin@smedbergs.us>, r=me
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -167,28 +167,23 @@ endif
 ALL_TRASH		= $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
 			  $(NOSUCHFILE) \
 			  so_locations
 
 ifndef RELEASE_LIBS_DEST
 RELEASE_LIBS_DEST	= $(RELEASE_LIB_DIR)
 endif
 
+define MAKE_DIR
+	$(MAKE) -C $(dir) $@
+
+endef
+
 ifdef DIRS
-LOOP_OVER_DIRS		=					\
-	@for d in $(DIRS); do					\
-		if test -d $$d; then				\
-			set -e;					\
-			echo "cd $$d; $(MAKE) $@";		\
-			$(MAKE) -C $$d $@;			\
-			set +e;					\
-		else						\
-			echo "Skipping non-directory $$d...";	\
-		fi;						\
-	done
+LOOP_OVER_DIRS = $(foreach dir,$(wildcard $(DIRS)),$(MAKE_DIR))
 endif
 
 ################################################################################
 
 all:: export
 
 export::
 	+$(LOOP_OVER_DIRS)