Browse code

Makefile:modules fixed usage of -jN flag for modules(_k,_s)

Removed the @for construct (launched a new shell) with a @foreach construct which does a textual expansion
of the block in question (loop unrolling)

Marius Zbihlei authored on 04/02/2010 13:06:54
Showing 2 changed files
... ...
@@ -603,17 +603,7 @@ $(1)_target=$(prefix)/$(modules_dir)$(1)
603 603
 
604 604
 .PHONY: $(1)
605 605
 $(1): modules.lst
606
-	@for r in $($(1)) "" ; do \
607
-		if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
608
-			$(call oecho, "" ;) \
609
-			$(call oecho, "" ;) \
610
-			if  $(MAKE) -C $$$$r $$(mk_params) || [ ${err_fail} != 1 ] ; then \
611
-				:; \
612
-			else \
613
-				exit 1; \
614
-			fi ; \
615
-		fi ; \
616
-	done; true
606
+	@$(foreach r,$($(1)),$(call module_make,$(r),$(mk_params)))
617 607
 
618 608
 .PHONY: $(1)-doc
619 609
 $(1)-doc: modules.lst
... ...
@@ -76,6 +76,16 @@ quiet=verbose
76 76
 oecho=echo $(1)
77 77
 endif
78 78
 
79
+module_make=	if [ -n "$(1)" -a -r "$(1)/Makefile" ]; then \
80
+			$(call oecho, "" ;) \
81
+			$(call oecho, "" ;) \
82
+			if  $$(MAKE) -C $(1) $(2) || [ ${err_fail} != 1 ] ; then \
83
+				:; \
84
+			else \
85
+				exit 1; \
86
+			fi ; \
87
+		fi ;
88
+
79 89
 quote:= "
80 90
 escall= $(subst $$,\$$,$(subst $(quote),\$(quote),$1))
81 91
 exec_cmd= $(if $($(quiet)_cmd_$(1)),\