Skip to content
Snippets Groups Projects
Commit 67b060b4 authored by Chris Packham's avatar Chris Packham Committed by Tom Rini
Browse files

Makefile: use $(shell ...) for determining file_size


file_size was being calculated using back-ticks but map_size uses
$(shell ...). Update the file_size calculation to use $(shell ...).

From: Jeroen Hofstee <jeroen@myspectrum.nl>

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.

Signed-off-by: default avatarChris Packham <judge.packham@gmail.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent ded2e20e
No related branches found
No related tags found
No related merge requests found
...@@ -803,7 +803,7 @@ u-boot.hex u-boot.srec: u-boot FORCE ...@@ -803,7 +803,7 @@ u-boot.hex u-boot.srec: u-boot FORCE
OBJCOPYFLAGS_u-boot.bin := -O binary OBJCOPYFLAGS_u-boot.bin := -O binary
binary_size_check: u-boot.bin System.map FORCE 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 | \ 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)}' \ awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \
| bc); \ | bc); \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment