From patchwork Wed Jul 23 19:59:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Hofstee X-Patchwork-Id: 373039 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 A0C5D1400AB for ; Thu, 24 Jul 2014 05:59:33 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83734A7545; Wed, 23 Jul 2014 21:59:30 +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 DIzX0Sm-kb4S; Wed, 23 Jul 2014 21:59:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BD95A7548; Wed, 23 Jul 2014 21:59:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 60988A7548 for ; Wed, 23 Jul 2014 21:59:24 +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 mfzu+IfE0DYR for ; Wed, 23 Jul 2014 21:59:22 +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 orange.myspectrum.nl (orange.myspectrum.nl [149.210.134.247]) by theia.denx.de (Postfix) with ESMTP id 36D24A7545 for ; Wed, 23 Jul 2014 21:59:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by orange.myspectrum.nl (Postfix) with ESMTP id 7211E8DE4A; Wed, 23 Jul 2014 21:59:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at myspectrum.nl Received: from orange.myspectrum.nl ([127.0.0.1]) by localhost (orange.myspectrum.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gbZxvP2YlGPF; Wed, 23 Jul 2014 21:59:17 +0200 (CEST) Received: from yellow (ip136-5-208-87.adsl2.static.versatel.nl [87.208.5.136]) (Authenticated sender: jeroen@myspectrum.nl) by orange.myspectrum.nl (Postfix) with ESMTPSA id F1A0E8DE34; Wed, 23 Jul 2014 21:59:16 +0200 (CEST) Received: by yellow (Postfix, from userid 1000) id 76E5C7419B1; Wed, 23 Jul 2014 21:59:16 +0200 (CEST) From: Jeroen Hofstee To: u-boot@lists.denx.de Date: Wed, 23 Jul 2014 21:59:09 +0200 Message-Id: <1406145549-21773-1-git-send-email-jeroen@myspectrum.nl> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405879691-14135-1-git-send-email-jeroen@myspectrum.nl> References: <1405879691-14135-1-git-send-email-jeroen@myspectrum.nl> Cc: Jeroen Hofstee , Chris Packham Subject: [U-Boot] [PATCH v2] Makefile: fix binary_size_check target 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 first issue replace stat -c %s with wc: The binary_size_check target relies on stat -c %s to return the size of u-boot.bin. This only works with GNU stat though. Use wc instead. Second issue as reported by chris Packham: file_size was being calculated using back-ticks but map_size uses $(shell ...). Update the file_size calculation to use $(shell ...). cc: Simon Glass Signed-off-by: Jeroen Hofstee Signed-off-by: Chris Packham --- Chris Packham: The back ticks didn't work in my environment (GNU Make 3.81). Updating to use $(shell ...) makes sense from a consistency view even if the problem is my environment. changes since v1: use $(shell ...) as submitted by Chris Packham --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca212b5..1156133 100644 --- a/Makefile +++ b/Makefile @@ -786,7 +786,7 @@ u-boot.hex u-boot.srec: u-boot FORCE OBJCOPYFLAGS_u-boot.bin := -O binary binary_size_check: u-boot.bin System.map FORCE - @file_size=`stat -c %s u-boot.bin` ; \ + file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \ map_size=$(shell cat System.map | \ awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ | bc); \