summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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;