forked from jschanck-si/supercop-fastbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata-summarize
executable file
·62 lines (54 loc) · 1.36 KB
/
data-summarize
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/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"