Commit 40ac9a5e authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

from  Benoît Perrot  <benoit@lrde.epita.fr>

	Use a dedicated script to launch bison to control the directory
	where the generated files are output.

	* config/move-if-change, config/bison++: Provided by Akim Demaille.
	* config/Makefile.am: Distribute them.
	* src/parse/Makefile.am: Use bison++.
parent 89d49396
2004-10-04 Benot Perrot <benoit@lrde.epita.fr>
Use a dedicated script to launch bison to control the directory
where the generated files are output.
* config/move-if-change, config/bison++: Provided by Akim Demaille.
* config/Makefile.am: Distribute them.
* src/parse/Makefile.am: Use bison++.
2004-10-03 Benot Perrot <benoit@lrde.epita.fr>
* dev/inst-nodes-mk-gen.py: Split into...
......
## Makefile.am -- Process this file with automake to produce Makefile.in
##
dist_noinst_SCRIPTS = move-if-change bison++
EXTRA_DIST = $(SPECIFIC_MACROS) $(STANDARD_MACROS) $(SPECIFIC_TOOLS)
MAINTAINERCLEANFILES = \
......
#! /bin/sh
# Any tool failure is a failure of the script.
set -e
# bison++ SRCDIR INPUT OUTPUT OPTIONS
# -----------------------------------
me=$(basename $0)
auxdir=$(cd $(dirname $0) && pwd)
srcdir=$1
shift
input=$1
shift
output=$1
shift
options="-S lalr1.cc $@"
# Alexandre Duret-Lutz also notes that in VPATH-builds $(srcdir) can
# be an absolute path depending on how ./configure is called ...
# In that case
# bison $(srcdir)/parsetiger.yy [...]
# will hard code the path in the maintainer's tree. Hence, do not use
# paths with Bison, chdir there.
# A tmp dir.
tmp=$output.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
cd $tmp
bison $options -S lalr1.cc $input -o $output
for file in *
do
case $file in
$input) ;;
*) $auxdir/move-if-change $file ../$srcdir/$file;;
esac
done
# Get rid of the tmp dir.
cd ..
rm -rf $tmp
#!/bin/sh
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is 0 if $2 is changed, 1 otherwise.
if
test -r $2
then
if
cmp -s $1 $2
then
echo $2 is unchanged
rm -f $1
else
mv -f $1 $2
fi
else
mv -f $1 $2
fi
......@@ -30,18 +30,21 @@ parse-asm-parse.stamp: $(top_srcdir)/dev/parse-asm-parse-gen.py $(top_srcdir)/de
@mv -f $@.tmp $@
asm-parse.yy: parse-asm-parse.stamp
bison.stamp: asm-parse.yy
@rm -rf $@.tmp
@touch $@.tmp
bison -S lalr1.cc -d -ra asm-parse.yy -o asm-parse.cc
@mv -f $@.tmp $@
BISONXX = $(top_srcdir)/config/bison++
EXTRA_DIST = $(srcdir)/bison++.stamp
$(srcdir)/bison++.stamp: $(srcdir)/asm-parse.yy
@rm -rf bison++.stamp.tmp
@touch bison++.stamp.tmp
$(BISONXX) $(srcdir) asm-parse.yy asm-parse.cc -d -ra
@mv -f bison++.stamp.tmp $@
# Run bison if a file that can be created by it is missing:
asm-parse.cc $(FROM_ASM_PARSE_YY): bison.stamp
@if test ! -f $@; then \
@rm -f bison.stamp; \
$(MAKE) $(AM_MAKEFLAGS) bison.stamp; \
$(srcdir)/asm-parse.cc $(FROM_ASM_PARSE_YY): $(srcdir)/bison++.stamp
@if test ! -f $@; then \
rm -f $(srcdir)/bison++.stamp; \
$(MAKE) $(AM_MAKEFLAGS) $(srcdir)/bison++.stamp; \
fi
MAINTAINERCLEANFILES = asm-scan.ll asm-scan.yy $(FROM_ASM_PARSE_YY)
......
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