From patchwork Mon Jun 24 15:43:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 253895 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 0A4892C0090 for ; Tue, 25 Jun 2013 01:44:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CAEEB4A03A; Mon, 24 Jun 2013 17:44:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qZAfjxjJaop6; Mon, 24 Jun 2013 17:44:55 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DBEC64A02A; Mon, 24 Jun 2013 17:44:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A382F4A023 for ; Mon, 24 Jun 2013 17:44:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m2xLlHBzkG6w for ; Mon, 24 Jun 2013 17:44:04 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 429564A020 for ; Mon, 24 Jun 2013 17:44:01 +0200 (CEST) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id D4C9B6446; Mon, 24 Jun 2013 09:53:48 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 5AA2CE463C; Mon, 24 Jun 2013 09:43:59 -0600 (MDT) From: Stephen Warren To: u-boot@lists.denx.de, Tom Rini Date: Mon, 24 Jun 2013 09:43:43 -0600 Message-Id: <1372088629-14134-4-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1372088629-14134-1-git-send-email-swarren@wwwdotorg.org> References: <1372088629-14134-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: Stephen Warren , Tom Warren Subject: [U-Boot] [PATCH V2 3/9] dts/Makefile: simplify dtc invocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Stephen Warren The invocation of dtc is significantly more complex that it could be, in order to work around an issue on old versions of dtc, which print a message to stdout every time they run. Remove this workaround, on the assumption that people have or will upgrade to a newer version of dtc. This simplifies the build rule significantly. Related, split the invocation of cpp and dtc into separate commands rather than a pipeline, so that if either fail, it is detected. This has the nice benefit of saving off the result of the pre-processing step, allowing it to be easily inspected. Assuming a new enough dtc (which an earlier patch enforces), dtc will parse #line directives in its input file, and generate correct file and line numbers in error messages, even though cpp is unconditionally applied to its input file. Signed-off-by: Stephen Warren Acked-by: Simon Glass --- v2: * Added note to commit description re: line numbers. * s/.dtstmp/dts.tmp/ in temporary filenames. --- .gitignore | 1 + dts/Makefile | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4116448..7aa4adc 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *.patch *.bin *.cfgtmp +*.dts.tmp # Build tree /build-* diff --git a/dts/Makefile b/dts/Makefile index 03e163e..722cc37 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -51,13 +51,8 @@ all: $(obj).depend $(LIB) DT_BIN := $(obj)dt.dtb $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts - rc=$$( \ - cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \ - { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \ - echo $$? >&3 ; } | \ - grep -v '^DTC: dts->dtb on file' ; \ - } 3>&1 1>&2 ) ; \ - exit $$rc + $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp + $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp process_lds = \ $(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'