From patchwork Tue Aug 2 20:34:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 655140 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s3nxw1Qphz9t2m for ; Wed, 3 Aug 2016 06:34:59 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B6B5888D76; Tue, 2 Aug 2016 20:34:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r4LRVkEt5qSR; Tue, 2 Aug 2016 20:34:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C050C88D0D; Tue, 2 Aug 2016 20:34:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 68C7B1CF691 for ; Tue, 2 Aug 2016 20:34:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6767888C30 for ; Tue, 2 Aug 2016 20:34:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uf7senmxonZ2 for ; Tue, 2 Aug 2016 20:34:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by whitealder.osuosl.org (Postfix) with ESMTP id B1B1289560 for ; Tue, 2 Aug 2016 20:34:51 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 7055C51; Tue, 2 Aug 2016 22:34:51 +0200 (CEST) Received: from localhost (132.230.147.77.rev.sfr.net [77.147.230.132]) by mail.free-electrons.com (Postfix) with ESMTPSA id EE6A325B; Tue, 2 Aug 2016 22:34:40 +0200 (CEST) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Tue, 2 Aug 2016 22:34:36 +0200 Message-Id: <1470170076-28901-2-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470170076-28901-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1470170076-28901-1-git-send-email-thomas.petazzoni@free-electrons.com> Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH 2/2] ncurses: use foreach make loops instead of shell for loops X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The main benefit of using make foreach loops is that they will abort if one of the iteration of the loop fails. The current for loops will continue, and only report a failure if the last iteration was a failure, but will silently ignore other errors. Signed-off-by: Thomas Petazzoni Reviewed-by: Matt Weber --- package/ncurses/ncurses.mk | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk index 0ae8835..614b6ce 100644 --- a/package/ncurses/ncurses.mk +++ b/package/ncurses/ncurses.mk @@ -74,28 +74,26 @@ NCURSES_CONF_OPTS += --enable-widec NCURSES_LIB_SUFFIX = w define NCURSES_LINK_LIBS_STATIC - for lib in $(NCURSES_LIBS-y:%=lib%); do \ - ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \ - $(1)/usr/lib/$${lib}.a; \ - done + $(foreach lib,$(NCURSES_LIBS-y:%=lib%), \ + ln -sf $(lib)$(NCURSES_LIB_SUFFIX).a $(1)/usr/lib/$(lib).a + ) ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \ $(1)/usr/lib/libcurses.a endef define NCURSES_LINK_LIBS_SHARED - for lib in $(NCURSES_LIBS-y:%=lib%); do \ - ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \ - $(1)/usr/lib/$${lib}.so; \ - done + $(foreach lib,$(NCURSES_LIBS-y:%=lib%), \ + ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(1)/usr/lib/$(lib).so + ) ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \ $(1)/usr/lib/libcurses.so endef define NCURSES_LINK_PC - for pc in $(NCURSES_LIBS-y); do \ - ln -sf $${pc}$(NCURSES_LIB_SUFFIX).pc \ - $(1)/usr/lib/pkgconfig/$${pc}.pc; \ - done + $(foreach pc,$(NCURSES_LIBS-y), \ + ln -sf $(pc)$(NCURSES_LIB_SUFFIX).pc \ + $(1)/usr/lib/pkgconfig/$(pc).pc + ) endef NCURSES_LINK_TARGET_LIBS = \ @@ -135,19 +133,19 @@ endef ifneq ($(BR2_STATIC_LIBS),y) define NCURSES_INSTALL_TARGET_LIBS - for lib in $(NCURSES_LIBS-y:%=lib%); do \ - cp -dpf $(NCURSES_DIR)/lib/$${lib}$(NCURSES_LIB_SUFFIX).so* \ - $(TARGET_DIR)/usr/lib/; \ - done + $(foreach lib,$(NCURSES_LIBS-y:%=lib%), \ + cp -dpf $(NCURSES_DIR)/lib/$(lib)$(NCURSES_LIB_SUFFIX).so* \ + $(TARGET_DIR)/usr/lib/ + ) endef endif ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y) define NCURSES_INSTALL_TARGET_PROGS - for x in $(NCURSES_PROGS); do \ - $(INSTALL) -m 0755 $(NCURSES_DIR)/progs/$$x \ - $(TARGET_DIR)/usr/bin/$$x; \ - done + $(foreach prog,$(NCURSES_PROGS), \ + $(INSTALL) -m 0755 $(NCURSES_DIR)/progs/$(prog) \ + $(TARGET_DIR)/usr/bin/$(prog) + ) ln -sf tset $(TARGET_DIR)/usr/bin/reset endef endif