From 21eb27c76e0e265ccdb4bfbb51411e16e910fe63 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 30 Sep 2023 09:54:19 +0200 Subject: [PATCH] package/gcc/gcc-final: move to make foreach loops This provides better error handling, and is more in line with our current coding style. We also replace ";" by "&&" for the same reason of proper error handling. Signed-off-by: Thomas Petazzoni Signed-off-by: Romain Naour --- package/gcc/gcc-final/gcc-final.mk | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index 0f94579ac4..7951b0f1a9 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -169,30 +169,30 @@ endif HOST_GCC_FINAL_USR_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_LIBS)) define HOST_GCC_FINAL_INSTALL_STATIC_LIBS - for i in $(HOST_GCC_FINAL_LIBS) ; do \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.a \ - $(STAGING_DIR)/lib/ ; \ - done - for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.a \ - $(STAGING_DIR)/usr/lib/ ; \ - done + $(foreach lib,$(HOST_GCC_FINAL_LIBS), \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).a \ + $(STAGING_DIR)/lib/ + ) + $(foreach lib,$(HOST_GCC_FINAL_USR_LIBS), \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).a \ + $(STAGING_DIR)/usr/lib/ + ) endef ifeq ($(BR2_STATIC_LIBS),) define HOST_GCC_FINAL_INSTALL_SHARED_LIBS - for i in $(HOST_GCC_FINAL_LIBS) ; do \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \ - $(STAGING_DIR)/lib/ ; \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \ - $(TARGET_DIR)/lib/ ; \ - done - for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \ - $(STAGING_DIR)/usr/lib/ ; \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$${i}.so* \ - $(TARGET_DIR)/usr/lib/ ; \ - done + $(foreach lib,$(HOST_GCC_FINAL_LIBS), \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ + $(STAGING_DIR)/lib/ && \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ + $(TARGET_DIR)/lib/ + ) + $(foreach lib,$(HOST_GCC_FINAL_USR_LIBS), \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ + $(STAGING_DIR)/usr/lib/ && \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ + $(TARGET_DIR)/usr/lib/ + ) endef endif