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
|
#!/bin/sh
#
# the purpose of this program is to test that each header (include/*.h) will
# properly compile stand-alone.
#
# a .cpp file is created for each header, and include for that specific header
# is added to the .cpp file. The #include line is the only line in the header.
# This is then compiled. There should be no errors or warnings.
#
outDir=cctest-$$-$RANDOM/
mkdir $outDir
RETCODE=0
for i in include/smbios/*.h ;
do
echo "Test standalone compilation of $i"
echo "#include \"smbios/$(basename $i)\"" > $outDir/$(basename $i .h).cpp
gcc -Wall -c -Iinclude -o $outDir/$(basename $i .h).o $outDir/$(basename $i .h).cpp
if [ $? -ne 0 ]; then RETCODE=$?; fi
done
rm -rf $outDir
exit $RETCODE
|