diff mbox

[U-Boot] Makefile: replace stat -c %s with wc

Message ID 1405879691-14135-1-git-send-email-jeroen@myspectrum.nl
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Jeroen Hofstee July 20, 2014, 6:08 p.m. UTC
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.

cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass July 21, 2014, 2:20 a.m. UTC | #1
On 20 July 2014 12:08, Jeroen Hofstee <jeroen@myspectrum.nl> wrote:
> 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.
>
> cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

Acked-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 5277781..5d8e4ba 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=`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); \