From patchwork Mon Oct 26 13:10:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1387732 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=SZPGAwPZ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKZwQ5PXbz9sTK for ; Tue, 27 Oct 2020 00:11:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8945D81F7C; Mon, 26 Oct 2020 14:11:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="SZPGAwPZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D734823E3; Mon, 26 Oct 2020 14:11:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 84943806C5 for ; Mon, 26 Oct 2020 14:10:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00EE020756; Mon, 26 Oct 2020 13:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603717858; bh=ySOrXAE2SArr79MdWIpUXfAW2Tr+YOwNUU9eV4ZmXd4=; h=From:To:Cc:Subject:Date:From; b=SZPGAwPZ19D7eGvRXQGMVwt2nU0v7i1XO99JO1FG/dLLmgOaZtuM+jJXZecdvX0K+ G0UiOnKvNVYG17aeUCFdy8JOWZgA9cJDsmR1r2bPavhsmQby+nKJNRHgyI69bAz5VF KcU7hjuOSXHRBb/5TOaAX8Q8oj1oaC/Ie6LQCel0= Received: by pali.im (Postfix) id 99B3AA4B; Mon, 26 Oct 2020 14:10:55 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Simon Glass , Bin Meng , Kever Yang , Jagan Teki , Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: [PATCH] Makefile: Correctly propagate failure when removing target Date: Mon, 26 Oct 2020 14:10:49 +0100 Message-Id: <20201026131049.17443-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean On more places is used pattern 'command > $@ || rm -f $@'. But it does not propagate failure from 'command' as 'rm -f' returns success. Fix it by calling 'false' to correctly propagate failure after 'rm -f'. Signed-off-by: Pali Rohár Reviewed-by: Simon Glass --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5a0ef18668..94feb7d9a5 100644 --- a/Makefile +++ b/Makefile @@ -1005,7 +1005,7 @@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@ append = cat $(filter-out $< $(PHONY), $^) >> $@ quiet_cmd_pad_cat = CAT $@ -cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@ +cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; } quiet_cmd_lzma = LZMA $@ cmd_lzma = lzma -c -z -k -9 $< > $@ @@ -1312,7 +1312,7 @@ endif shell_cmd = { $(echo-cmd) $(cmd_$(1)); } quiet_cmd_objcopy_uboot = OBJCOPY $@ -cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || rm -f $@ +cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_SYS_TEXT_BASE)) || { rm -f $@; false; } u-boot-nodtb.bin: u-boot FORCE $(call if_changed,objcopy_uboot) @@ -1584,12 +1584,12 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE ifneq ($(CONFIG_ARCH_SOCFPGA),) quiet_cmd_gensplx4 = GENSPLX4 $@ cmd_gensplx4 = cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \ - spl/u-boot-spl.sfp spl/u-boot-spl.sfp > $@ || rm -f $@ + spl/u-boot-spl.sfp spl/u-boot-spl.sfp > $@ || { rm -f $@; false; } spl/u-boot-splx4.sfp: spl/u-boot-spl.sfp FORCE $(call if_changed,gensplx4) quiet_cmd_socboot = SOCBOOT $@ -cmd_socboot = cat spl/u-boot-splx4.sfp u-boot.img > $@ || rm -f $@ +cmd_socboot = cat spl/u-boot-splx4.sfp u-boot.img > $@ || { rm -f $@; false; } u-boot-with-spl.sfp: spl/u-boot-splx4.sfp u-boot.img FORCE $(call if_changed,socboot) @@ -1599,12 +1599,12 @@ cmd_gensplpadx4 = dd if=/dev/zero of=spl/u-boot-spl.pad bs=64 count=1024 ; \ spl/u-boot-spl.sfp spl/u-boot-spl.pad \ spl/u-boot-spl.sfp spl/u-boot-spl.pad \ spl/u-boot-spl.sfp spl/u-boot-spl.pad > $@ || \ - rm -f $@ spl/u-boot-spl.pad + { rm -f $@ spl/u-boot-spl.pad; false; } u-boot-spl-padx4.sfp: spl/u-boot-spl.sfp FORCE $(call if_changed,gensplpadx4) quiet_cmd_socnandboot = SOCNANDBOOT $@ -cmd_socnandboot = cat u-boot-spl-padx4.sfp u-boot.img > $@ || rm -f $@ +cmd_socnandboot = cat u-boot-spl-padx4.sfp u-boot.img > $@ || { rm -f $@; false; } u-boot-with-nand-spl.sfp: u-boot-spl-padx4.sfp u-boot.img FORCE $(call if_changed,socnandboot)