3 # rebuild our heimdal lex/yacc files. Run this manually if you update heimdal
5 lexfiles
="heimdal/lib/asn1/lex.l heimdal/lib/hx509/sel-lex.l heimdal/lib/com_err/lex.l"
6 yaccfiles
="heimdal/lib/asn1/asn1parse.y heimdal/lib/hx509/sel-gram.y heimdal/lib/com_err/parse.y"
18 echo "Calling $LEX on $lfile"
21 base
=$
(basename $lfile .l
)
29 if [ -r lex.yy.c
]; then
30 echo "#include \"config.h\"" > $base.c
31 sed -e "s|lex\.yy\.c|$cfile|" lex.yy.c
>> $base.c
33 elif [ -r $base.yy.c
]; then
34 echo "#include \"config.h\"" > $base.c
35 sed -e "s|$base\.yy\.c|$cfile|" $base.yy.c
>> $base.c
37 elif [ -r $base.c
]; then
38 mv $base.c
$base.c.tmp
39 echo "#include \"config.h\"" > $base.c
40 sed -e "s|$base\.yy\.c|$cfile|" $base.c.tmp
>> $base.c
42 elif [ ! -r base.c
]; then
43 echo "$base.c nor $base.yy.c nor lex.yy.c generated."
53 echo "Calling $YACC on $yfile"
56 base
=$
(basename $yfile .y
)
62 $YACC -d $yfile ||
exit 1
63 if [ -r y.tab.h
-a -r y.tab.c
];then
64 sed -e "/^#/!b" -e "s|y\.tab\.h|$cfile|" -e "s|\"$base.y|\"$cfile|" y.tab.h
> $base.h
65 sed -e "s|y\.tab\.c|$cfile|" -e "s|\"$base.y|\"$cfile|" y.tab.c
> $base.c
67 elif [ ! -r $base.h
-a ! -r $base.c
]; then
68 echo "$base.h nor $base.c generated."
76 for lfile
in $lexfiles; do
80 for yfile
in $yaccfiles; do