summaryrefslogtreecommitdiff
path: root/tools/ck-mparam
blob: 3878dcf235a117812165235173b51b3414e9b3e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# Check the mparam.h files. This script is useful as not all mparam.h
# files may be tested by our tests.

# Copyright 2011-2017 Free Software Foundation, Inc.
# This script is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

# ck-mparam can be run from the tools directory
dir=`pwd`
[ -d src ] || [ "`basename "$dir"`" != tools ] || cd ..

files=`find src/*/ -name mparam.h`
err=0

for i in $files
do
  output=`echo "#include \"$i\"" | gcc -o /dev/null -c -xc - 2>&1`
  [ -z "$output" ] && continue
  printf "Error for file '%s':\n%s\n" "$i" "$output"
  err=1
done

exit $err