mirror of
https://github.com/raphnet/dreamcast_usb
synced 2024-12-21 06:38:52 -05:00
36 lines
733 B
Bash
Executable File
36 lines
733 B
Bash
Executable File
#!/bin/sh
|
|
# Name: checksize
|
|
# Project: AVR-USB
|
|
# Author: Christian Starkjohann
|
|
# Creation Date: 2004-12-29
|
|
# Tabsize: 4
|
|
# Copyright: (c) 2005 OBJECTIVE DEVELOPMENT Software GmbH.
|
|
# Revision: $Id: checksize,v 1.1 2013-10-13 21:01:08 cvs Exp $
|
|
|
|
error=0
|
|
codelimit=8192
|
|
datalimit=960 # leave 64 bytes for stack
|
|
|
|
if [ $# -gt 1 ]; then
|
|
codelimit="$2"
|
|
fi
|
|
if [ $# -gt 2 ]; then
|
|
datalimit="$3"
|
|
fi
|
|
|
|
set -- `avr-size -d "$1" | awk '/[0-9]/ {print $1 + $2, $2 + $3, $2}'`
|
|
if [ $1 -gt $codelimit ]; then
|
|
echo "*** code size $1 exceeds limit of $codelimit"
|
|
error=1
|
|
else
|
|
echo "ROM: $1 bytes (data=$3)"
|
|
fi
|
|
if [ $2 -gt $datalimit ]; then
|
|
echo "*** data size $2 exceeds limit of $datalimit"
|
|
error=1
|
|
else
|
|
echo "RAM: $2 bytes"
|
|
fi
|
|
|
|
exit $error
|