Commit 2e252544 authored by Roland Levillain's avatar Roland Levillain
Browse files

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.
parent 9b49936e
2006-10-31 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.
2006-04-17 Benoit Perrot <benoit@lrde.epita.fr> 2006-04-17 Benoit Perrot <benoit@lrde.epita.fr>
Make extraction of option's value more conventional. Make extraction of option's value more conventional.
......
#! /bin/sh #! /bin/sh
# Exit status.
status=0
# Any tool failure is a failure of the script. # Any tool failure is a failure of the script.
set -e set -e
: ${BISON=@BISON@} : ${BISON=@BISON@}
# bison++ SRCDIR INPUT OUTPUT OPTIONS # bison++ INPUT OUTPUT OPTIONS
# ----------------------------------- # ----------------------------
me=$(basename $0) me=$(basename $0)
move_if_change='@abs_srcdir@/move-if-change' move_if_change='@abs_srcdir@/move-if-change'
srcdir=$1
abs_srcdir=$(cd $srcdir && pwd)
shift
input=$1 input=$1
input_base=$(basename "$input")
shift shift
output=$1 output=$1
output_base=$(basename "$output")
output_dir=$(dirname "$output")
output_dir_abs=$(cd "$output_dir" && pwd)
shift shift
options="-d -ra $@" options="$@"
# Alexandre Duret-Lutz also notes that in VPATH-builds $(srcdir) can # Alexandre Duret-Lutz also notes that in VPATH-builds $(srcdir) can
# be an absolute path depending on how ./configure is called ... # be an absolute path depending on how ./configure is called ...
...@@ -30,30 +34,36 @@ options="-d -ra $@" ...@@ -30,30 +34,36 @@ options="-d -ra $@"
# paths with Bison, chdir there. # paths with Bison, chdir there.
# A tmp dir. # A tmp dir.
tmp=$output.dir tmp=$output_base.dir
rm -rf $tmp rm -rf $tmp
mkdir $tmp mkdir $tmp
# Compile in this dir. # Compile in this dir.
# Don't use `ln -s' as its semantics of paths sucks. # Don't use `ln -s' as its semantics of paths sucks.
cp $srcdir/$input $tmp cp $input $tmp
cd $tmp cd $tmp
$BISON $options $input -o $output set +e
$BISON $options $input_base -o $output_base
for file in * status=$?
do set -e
case $file in
$input) if test $status = 0; then
# Leave it here. for file in *
;; do
*) case $file in
# Fix doxygen tags. $input_base)
perl -pi -e "s|\Q\\file $file\E\b|\\\\file parse/$file|g;" "$file" # Leave it here.
$move_if_change "$file" "$abs_srcdir/$file" ;;
;; *)
esac # Fix doxygen tags.
done perl -pi -e "s|\Q\\file $file\E\b|\\\\file parse/$file|g;" "$file"
$move_if_change "$file" "$output_dir_abs/$file"
;;
esac
done
fi
# Get rid of the tmp dir. # Get rid of the tmp dir.
cd .. cd ..
rm -rf $tmp rm -rf $tmp
exit $status
...@@ -41,7 +41,7 @@ $(srcdir)/bison++.stamp: $(srcdir)/asm-parse.yy $(BISONXX_IN) ...@@ -41,7 +41,7 @@ $(srcdir)/bison++.stamp: $(srcdir)/asm-parse.yy $(BISONXX_IN)
$(MAKE) $(AM_MAKEFLAGS) $(BISONXX) $(MAKE) $(AM_MAKEFLAGS) $(BISONXX)
@rm -rf bison++.stamp.tmp @rm -rf bison++.stamp.tmp
@touch 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 $@ @mv -f bison++.stamp.tmp $@
# Run bison if a file that can be created by it is missing: # Run bison if a file that can be created by it is missing:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment