Skip to contentSkip to conversation

linux: replace shell for loop with make foreach loop

PATCH New Thomas Petazzoni 2 participants 2 messages Aug 16, 2018 – Aug 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: replace shell for loop with make foreach loop

This commit replaces the loop copying out-of-tree DTS into the kernel tree by a make foreach loop instead of a shell for loop. This allows to error out if one of the DTS file cannot be copied (for example if it doesn't exist).

---
 linux/linux.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
linux/linux.mk +3 -3
index 7527b11673..e0d437427d 100644
@@ -389,9 +389,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
-		cp -f $${dts} $(LINUX_ARCH_PATH)/boot/dts/ ; \
-	done
+	$(foreach dts,$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)), \
+		cp -f $(dts) $(LINUX_ARCH_PATH)/boot/dts/
+	)
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ; \
Signature · 1 line
2.14.4
#1 lore raw

PATCH 1/1 linux: replace shell for loop with make foreach loop

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

This commit replaces the loop copying out-of-tree DTS into the kernel tree by a make foreach loop instead of a shell for loop. This allows to error out if one of the DTS file cannot be copied (for example if it doesn't exist).

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard