Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Georgi | 302993f | 2010-11-18 15:07:06 +0000 | [diff] [blame] | 2 | # DESCR: Check that no symbols #defined in any romstage.c is used elsewhere |
Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 3 | DEFINES=`grep "#define" src/mainboard/*/*/romstage.c |sed 's,.*#define[\t ]\([^\t ]*\)[\t ].*,\1,' | grep -v "(" | sort -u` |
| 4 | SCANBUCKET=`mktemp` |
Patrick Georgi | 558362f | 2010-11-18 14:33:02 +0000 | [diff] [blame] | 5 | LC_ALL=C export LC_ALL |
| 6 | find src -name .svn -type d -prune -o -name mainboard -type d -prune -o -name examples -type d -prune -o -type f -exec sed -nf `dirname $0`/remccoms3.sed {} + > $SCANBUCKET |
Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 7 | |
| 8 | for define in $DEFINES; do |
| 9 | if [ `egrep -c "([^_A-Za-z0-9]$define[^_A-Za-z0-9]|^$define[^_A-Za-z0-9]|[^_A-Za-z0-9]$define\$)" $SCANBUCKET` -gt 0 ]; then |
| 10 | echo "$define is defined in mainboard(s) and used elsewhere" |
| 11 | fi |
| 12 | done |
| 13 | |
| 14 | rm -f $SCANBUCKET |