-
Notifications
You must be signed in to change notification settings - Fork 10
/
docmake.sh
executable file
·52 lines (40 loc) · 1.01 KB
/
docmake.sh
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
#!/bin/sh
all=docs/libssh2*.3
out="doc.mk"
nopath=`echo $all | sed -e 's:docs/::g'`
html=`echo $nopath | sed -e 's/\.3/.html/g'`
allraw=`echo $nopath | sed -e 's/\.3/.raw/g'`
echo "all: $html" > $out
echo "" >> $out
for i in $nopath; do
h=`echo $i | sed -e 's/\.3/.html/g'`
raw=`echo $i | sed -e 's/\.3/.raw/g'`
f=`echo $i | sed 's/\.3//g'`
echo "$h: func.t $raw \$(MAINPARTS)" >> $out
echo " \$(FCPP) \$(OPTS) -Dfunc=$f -Ddocs_$f -Dfuncinc=\\\"$raw\\\" \$< \$@" >> $out
echo "" >> $out
echo "$raw: docs/$i" >> $out
echo " \$(MAN2HTML) < \$< >\$@" >> $out
echo "" >> $out
done
echo "clean:" >> $out
echo " rm -f $html $allraw" >> $out
allfuncs=`echo $nopath | sed -e 's/\.3//g'`
newd=docmenu-new.t
echo '<div class="funcmenu">' > $newd
for i in $allfuncs; do
cat <<EOF >>$newd
<div
#ifdef docs_$i
class="itemselect"
#endif
><a href="$i.html">$i()</a></div>
EOF
done
echo '</div>' >> $newd
if { cmp -s $newd docmenu.t >/dev/null; } then
echo "same" >/dev/null
else
# echo "diff"
mv $newd docmenu.t
fi