Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 63 lines (54 sloc) 1.36 KB
#!/bin/sh
# supercop/data-summarize
# D. J. Bernstein
# Public domain.
. ./data-vars
(
cat OPERATIONS \
| while read o macros prototypes
do
ls "$o" \
| sort \
| while read p
do
[ -d "$o" ] || continue
okabi \
| while read abi
do
[ -d "$o/$p" ] || continue
find "$o/$p" -follow -name "api.h" \
| sort \
| while read doth
do
implementationdir=`dirname $doth`
cfiles=`ls "$implementationdir" | grep '\.c$' || :`
sfiles=`ls "$implementationdir" | grep '\.[sS]$' || :`
ccfiles=`ls "$implementationdir" | grep '\.cc$' || :`
cppfiles=`ls "$implementationdir" | grep '\.cpp$' || :`
language=c
[ "x$cppfiles" = x ] || language=cpp
[ "x$ccfiles" = x ] || language=cpp
ok${language}-$abi \
| while read compiler
do
compilerword=`echo "$compiler" | tr ' ' '_'`
if [ -f "$top/$abi/try/$language/$compilerword/$implementationdir/data" ]
then
grep . < "$top/$abi/try/$language/$compilerword/$implementationdir/data"
fi
done
done
for m in 1 2 3
do
if [ -f "$top/$abi/measure$m/$o/$p/data" ]
then
grep . < "$top/$abi/measure$m/$o/$p/data"
fi
done
done
done
done
sed 's/^/+ /' < "$top/log"
) | gzip -9 > "$top/data.gz.tmp"
mv "$top/data.gz.tmp" "$top/data.gz"
touch "$top/done-$version"