-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbld.sh
More file actions
executable file
·48 lines (43 loc) · 1.16 KB
/
bld.sh
File metadata and controls
executable file
·48 lines (43 loc) · 1.16 KB
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
#!/bin/sh
# bld.sh - Builds html pages
if which semlit.sh >/dev/null; then :
else :
echo "bld.sh: ERROR: semlit.sh not found in PATH."
exit 1
fi
if [ -n "$1" ]; then :
if [ ! -d "$1" ]; then :
echo "$1 not found" >&2
exit 1
fi
find "$1" -name README.txt -print >bld.tmp
else :
# Find all the examples
find * -name README.txt -print >bld.tmp
fi
# Build the semiliterate docs
cat bld.tmp | while read F; do : # find each tool
T=`dirname $F`
cd $T
find * -name "$T.sldoc" -print | while read DOC; do : # each language
D=`dirname $DOC`
echo "bld.sh: Info: $D/$T.sldoc: building semiliterate doc"
cd $D
chmod +w *.c *.h *.java *.cs >/dev/null 2>&1
semlit.sh "$T.sldoc"
# Don't let example maintainers edit the output files
chmod -w *.c *.h *.java *.cs >/dev/null 2>&1
# Try compile (check for errors)
if ls *.c >/dev/null 2>&1; then :
echo "bld.sh: Info: gcc -I$LBM_PLATFORM/include -g -c *.c"
gcc $* -I$LBM_PLATFORM/include -g -c *.c
rm -f *.o
fi
cd ..
done
cd ..
done
echo "bld.sh: Info: building html index files"
find * -name README.txt -print >bld.tmp
perl bld.pl bld.tmp
rm bld.tmp