nolimips 218: Catch up with TC's bison++.

https://svn.lrde.epita.fr/svn/nolimips/trunk Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Catch up with TC's bison++. * build-aux/bison++.in: Don't take a `dir' argument, use the dirnames of the input and output files. * src/parse/Makefile.am: Adjust bison++ invocation. build-aux/bison++.in | 32 +++++++++++++++++++++----------- src/parse/Makefile.am | 2 +- 2 files changed, 22 insertions(+), 12 deletions(-) Index: src/parse/Makefile.am --- src/parse/Makefile.am (revision 217) +++ src/parse/Makefile.am (working copy) @@ -41,7 +41,7 @@ $(MAKE) $(AM_MAKEFLAGS) $(BISONXX) @rm -rf bison++.stamp.tmp @touch bison++.stamp.tmp - $(BISONXX) $(srcdir) asm-parse.yy asm-parse.cc -d -ra + $(BISONXX) $(srcdir)/asm-parse.yy $(srcdir)/asm-parse.cc -d -ra @mv -f bison++.stamp.tmp $@ # Run bison if a file that can be created by it is missing: Index: build-aux/bison++.in --- build-aux/bison++.in (revision 217) +++ build-aux/bison++.in (working copy) @@ -1,24 +1,28 @@ #! /bin/sh +# Exit status. +status=0 + # Any tool failure is a failure of the script. set -e : ${BISON=@BISON@} -# bison++ SRCDIR INPUT OUTPUT OPTIONS -# ----------------------------------- +# bison++ INPUT OUTPUT OPTIONS +# ---------------------------- me=$(basename $0) move_if_change='@abs_srcdir@/move-if-change' -srcdir=$1 -abs_srcdir=$(cd $srcdir && pwd) -shift input=$1 +input_base=$(basename "$input") shift output=$1 +output_base=$(basename "$output") +output_dir=$(dirname "$output") +output_dir_abs=$(cd "$output_dir" && pwd) shift -options="-d -ra $@" +options="$@" # Alexandre Duret-Lutz also notes that in VPATH-builds $(srcdir) can # be an absolute path depending on how ./configure is called ... @@ -30,30 +34,36 @@ # paths with Bison, chdir there. # A tmp dir. -tmp=$output.dir +tmp=$output_base.dir rm -rf $tmp mkdir $tmp # Compile in this dir. # Don't use `ln -s' as its semantics of paths sucks. -cp $srcdir/$input $tmp +cp $input $tmp cd $tmp -$BISON $options $input -o $output +set +e +$BISON $options $input_base -o $output_base +status=$? +set -e +if test $status = 0; then for file in * do case $file in - $input) + $input_base) # Leave it here. ;; *) # Fix doxygen tags. perl -pi -e "s|\Q\\file $file\E\b|\\\\file parse/$file|g;" "$file" - $move_if_change "$file" "$abs_srcdir/$file" + $move_if_change "$file" "$output_dir_abs/$file" ;; esac done +fi # Get rid of the tmp dir. cd .. rm -rf $tmp +exit $status
participants (1)
-
Roland Levillain