Browse Source

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 15 years ago
parent
commit
329e20e2a8
2 changed files with 11 additions and 11 deletions
  1. 1 11
      Makefile
  2. 10 0
      Makefile.rules

+ 1 - 11
Makefile

@@ -603,17 +603,7 @@ $(1)_target=$(prefix)/$(modules_dir)$(1)
 
 .PHONY: $(1)
 $(1): modules.lst
-	@for r in $($(1)) "" ; do \
-		if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
-			$(call oecho, "" ;) \
-			$(call oecho, "" ;) \
-			if  $(MAKE) -C $$$$r $$(mk_params) || [ ${err_fail} != 1 ] ; then \
-				:; \
-			else \
-				exit 1; \
-			fi ; \
-		fi ; \
-	done; true
+	@$(foreach r,$($(1)),$(call module_make,$(r),$(mk_params)))
 
 .PHONY: $(1)-doc
 $(1)-doc: modules.lst

+ 10 - 0
Makefile.rules

@@ -76,6 +76,16 @@ quiet=verbose
 oecho=echo $(1)
 endif
 
+module_make=	if [ -n "$(1)" -a -r "$(1)/Makefile" ]; then \
+			$(call oecho, "" ;) \
+			$(call oecho, "" ;) \
+			if  $$(MAKE) -C $(1) $(2) || [ ${err_fail} != 1 ] ; then \
+				:; \
+			else \
+				exit 1; \
+			fi ; \
+		fi ;
+
 quote:= "
 escall= $(subst $$,\$$,$(subst $(quote),\$(quote),$1))
 exec_cmd= $(if $($(quiet)_cmd_$(1)),\