When multiple conditions are executed on a single character they need to have a
[external/ragel.git] / doc / genfigs.sh
1 #!/bin/bash
2 #
3
4 input=ragel-guide.tex
5
6 for fig; do
7         if awk -f extract.awk -vexname=$fig $input > /dev/null; then
8                 echo generating ${fig}.fig
9                 opt=`awk -f extract.awk -vexname=$fig $input | 
10                                 sed '/^ *OPT:/s/^.*: *//p;d'`
11                 awk -f extract.awk -vexname=$fig $input | \
12                         ragel | rlcodegen -V $opt | \
13                         dot -Tfig | awk -f fixbackbox.awk > ${fig}.fig;
14         else
15                 echo "$0: internal error: figure $fig not found in $input" >&2
16                 exit 1
17         fi
18 done
19