r22187: Test kerberos logins in the smbclient blackbox tests, including with a
[Samba.git] / source / script / lex_compile.sh
blob064bf89bea22474cc43780f22e76e48314c4e090
1 #!/bin/sh
3 LEX="$1"
4 SRC="$2"
5 DEST="$3"
7 dir=`dirname $SRC`
8 file=`basename $SRC`
9 base=`basename $SRC .l`
10 if [ -z "$LEX" ]; then
11 echo "lex not found - not regenerating $DEST"
12 exit;
14 if [ -r $DEST ]; then
15 if [ x`find $SRC -newer $DEST -print` != x$SRC ]; then
16 exit;
19 TOP=`pwd`
20 if cd $dir && $LEX $file; then
21 if [ -r $base.yy.c ];then
22 # we must guarantee that config.h comes first
23 echo "#include \"config.h\"" > $base.c
24 sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c >> $base.c
25 rm -f $base.yy.c
28 cd $TOP