summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-01-19 12:06:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-20 12:51:28 +0100
commit3de3b677ee3adc4e10235b623a8e0aa45be48893 (patch)
tree71dd2684902e3012de29f43d32a16b4d1cbfbc2d /scripts/Makefile.lib
parent6f142500387365a3b8a4331c2540b7aa2a9bf9b6 (diff)
downloadbarebox-3de3b677ee3adc4e10235b623a8e0aa45be48893.tar.gz
barebox-3de3b677ee3adc4e10235b623a8e0aa45be48893.tar.xz
Makefile: move cmd_check_file_size to Makefile.lib
so we can use to check pbl Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 14e471d17c..f7d672160c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -248,3 +248,14 @@ cmd_disasm = $(OBJDUMP) -d $< > $@
quiet_cmd_ln = LN $@
cmd_ln = ln -sf $< $@
+
+# Check size of a file
+quiet_cmd_check_file_size = CHKSIZE $@
+ cmd_check_file_size = set -e; \
+ size=`stat -c%s $@`; \
+ max_size=`printf "%d" $2`; \
+ if [ $$size -gt $$max_size ] ; \
+ then \
+ echo "$@ size $$size > of the maximum size $$max_size" >&2; \
+ exit 1 ; \
+ fi;