Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame^] | 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright (C) 2010 coresystems GmbH |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; version 2 of the License. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | # |
| 19 | # DESCR: Check that no symbol #defined in any romstage.c is used elsewhere |
| 20 | |
Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 21 | DEFINES=`grep "#define" src/mainboard/*/*/romstage.c |sed 's,.*#define[\t ]\([^\t ]*\)[\t ].*,\1,' | grep -v "(" | sort -u` |
| 22 | SCANBUCKET=`mktemp` |
Patrick Georgi | 558362f | 2010-11-18 14:33:02 +0000 | [diff] [blame] | 23 | LC_ALL=C export LC_ALL |
| 24 | 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] | 25 | |
| 26 | for define in $DEFINES; do |
| 27 | 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 |
| 28 | echo "$define is defined in mainboard(s) and used elsewhere" |
| 29 | fi |
| 30 | done |
| 31 | |
| 32 | rm -f $SCANBUCKET |