touch ChangeLog
aclocal -I m4 && autoheader && automake -a && autoconf
-
-for i in tests
-do
-( cd $i
- aclocal && autoheader && autoconf
-)
-done
AC_INIT(scan.l)
AM_INIT_AUTOMAKE(flex,2.5.6)
-AM_CONFIG_HEADER(config.h:conf.in)
+AM_CONFIG_HEADER(
+config.h:conf.in
+tests/config.h:tests/config.in
+)
AM_GNU_GETTEXT([external])
-AC_LN_S
-AC_PROG_CC
AC_PROG_YACC
+AC_CHECK_PROG(BISON, bison, bison)
AM_PROG_LEX
+AC_LN_S
+AC_PROG_CC
+
AC_PROG_RANLIB
AC_PATH_PROG(HELP2MAN, help2man, $srcdir/missing)
AC_HEADER_STDC
AC_HAVE_HEADERS(string.h malloc.h sys/types.h unistd.h)
-AC_CONFIG_SUBDIRS(tests)
-
AC_OUTPUT(
Makefile
examples/Makefile
examples/manual/Makefile
m4/Makefile
po/Makefile.in
+tests/Makefile
+tests/TEMPLATE/Makefile
+tests/test-array-nr/Makefile
+tests/test-array-r/Makefile
+tests/test-basic-nr/Makefile
+tests/test-basic-r/Makefile
+tests/test-bison-yylloc/Makefile
+tests/test-bison-yylval/Makefile
+tests/test-c-cpp-nr/Makefile
+tests/test-c-cpp-r/Makefile
+tests/test-header-nr/Makefile
+tests/test-header-r/Makefile
+tests/test-include-by-buffer/Makefile
+tests/test-include-by-reentrant/Makefile
+tests/test-multiple-scanners-nr/Makefile
+tests/test-multiple-scanners-r/Makefile
+tests/test-prefix-nr/Makefile
+tests/test-prefix-r/Makefile
+tests/test-pthread/Makefile
+tests/test-string-nr/Makefile
+tests/test-string-r/Makefile
+tests/test-yyextra/Makefile
)
config.h
config.log
Makefile
+aclocal.m4
+stamp-*
+Makefile.in
--- /dev/null
+# This file is part of flex.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+
+# Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE.
+
+EXTRA_DIST = \
+ README
+
+noinst_SCRIPTS = \
+ create-test
+
+SUBDIRS = \
+ TEMPLATE \
+ test-array-nr \
+ test-array-r \
+ test-basic-nr \
+ test-basic-r \
+ test-bison-yylloc \
+ test-bison-yylval \
+ test-c-cpp-nr \
+ test-c-cpp-r \
+ test-header-nr \
+ test-header-r \
+ test-include-by-buffer \
+ test-include-by-reentrant \
+ test-multiple-scanners-nr \
+ test-multiple-scanners-r \
+ test-prefix-nr \
+ test-prefix-r \
+ test-pthread \
+ test-string-nr \
+ test-string-r \
+ test-yyextra
+
+test:
+ NOK=;\
+ NFAIL=;\
+ NSKIP=;\
+ for dir in $(SUBDIRS) ; do \
+ echo Executing test "$$dir" ; \
+ ( cd "$$dir" && $(MAKE) test > OUTPUT 2>&1 ) ; \
+ case $$? in \
+ 0 ) echo Test "$$DIR" succeeded.; \
+ NOK=0$$NOK;\
+ ;; \
+ 1 ) echo Test "$$DIR" FAILED. See "$$dir"/OUTPUT for details. ; \
+ NFAIL=0$$NFAIL; \
+ ;; \
+ 2 ) echo Test "$$DIR" was SKIPPED. See "$$dir"/OUTPUT for details.; \
+ NSKIP=0$$NSKIP; \
+ ;; \
+ * ) echo Test "$$DIR" reported an unknown exit status. Assuming that means it failed. See "$$DIR"/OUTPUT for details.; \
+ NFAIL=0$$NFAIL; \
+ ;; \
+ esac; \
+ done ; \
+ echo Results: ; \
+ echo Tests succeeded: `echo @ECHO_N@ $$NOK@ECHO_C@|wc -c`; \
+ echo Tests SKIPPED: `echo @ECHO_N@ $$NSKIP@ECHO_C@|wc -c`; \
+ echo Tests FAILED: `echo @ECHO_N@ $$NFAIL@ECHO_C@|wc -c` ;
+++ /dev/null
-
-@SET_MAKE@
-
-TESTDIRS= @TESTDIRS@
-
-srcdir= @srcdir@
-
-
-all: build
-
-build:
- @for dir in $(TESTDIRS) ; do \
- (cd "$$dir" && $(MAKE) ) ; \
- done
- @echo "Type '`basename $(MAKE)` check' to run all tests."
-
-check:
- @nok=0;\
- nfail=0;\
- nskip=0;\
- for dir in $(TESTDIRS) ; do \
- echo -n Executing "$$dir" ; \
- dot=$$(( 30 - $${#dir} )); \
- while test $$dot -gt 0 ; do \
- echo -n '.'; \
- dot=$$(( $$dot - 1 )); \
- done; \
- ( cd "$$dir" && $(MAKE) check > OUTPUT 2>&1 ) ; \
- case $$? in \
- 0 ) echo OK.; \
- nok=$$(( $$nok + 1 )) ; \
- ;; \
- 1 ) echo "FAILED. See $$dir/OUTPUT for details." ; \
- nfail=$$(( $$nfail + 1 )) ; \
- ;; \
- 2 ) echo "SKIPPED. See $$dir/OUTPUT for details."; \
- nskip=$$(( $$nskip + 1 )) ; \
- ;; \
- * ) echo "FAILED? Unknown exit status reported."; \
- nfail=$$(( $$nfail + 1 )) ; \
- ;; \
- esac; \
- done ; \
- echo "Results: "; \
- echo " Tests OK: $$nok"; \
- echo " Tests SKIPPED: $$nskip"; \
- echo " Tests FAILED: $$nfail" ;
-
-distclean: clean
- @for dir in $(TESTDIRS) ; do \
- if test -f "$$dir/Makefile" ; then \
- (cd "$$dir" && $(MAKE) distclean ) ; \
- fi; \
- done
- rm -f config.h config.status config.log Makefile
-
-clean:
- @for dir in $(TESTDIRS) ; do \
- if test -f "$$dir/Makefile" ; then \
- (cd "$$dir" && $(MAKE) clean ) ; \
- fi ; \
- done
This file describes the flex test suite.
-WHO SHOULD USE THE TEST SUITE?
+* WHO SHOULD USE THE TEST SUITE?
The test suite is intended to be used by flex developers, i.e., anyone hacking
the flex distribution. If you are simply installing flex, then you can ignore
this directory and its contents.
-STRUCTURE OF THE TEST SUITE
+* STRUCTURE OF THE TEST SUITE
The test suite consists of several directories, each containing a
scanner known to work with the most recent version of flex. In
a feature of flex. At a minimum, you'll want to investigate the
failure and determine if it's truly significant.
-HOW TO RUN THE TEST SUITE
+* HOW TO RUN THE TEST SUITE
To build and execute all tests:
$ cd tests/ # from the top level of the flex source tree
- $ make check
+ $ make test
To build and execute a single test:
$ cd tests/ # from the top level of the flex tree.
$ cd test-pthread-nr # for example
- $ make check
-
-HOW TO ADD A NEW TEST TO THE TEST SUITE
-
- - RUN the perl script `create-test.pl` found in this directory.
- If it works, skip the next step.
-
- - Copy the tests/TEMPLATE directory, then modify the skeleton scanner
- (and parser if necessary). If you are submitting a patch for
- inclusion in the flex distribution, then move the file "cvsignore"
- to .cvsignore in your new test-* subdirectory and add the name of
- your directory on a line by itself at the end of the newly created
- .cvsignore file. This will make it easier on the flex maintainer to
- include your new test in the cvs tree.
-
- - On success, your test should return zero.
-
- - On error, your test should return 1 (one) and print a message
- to stdout or stderr, which have been redirected to the file
- named, "OUTPUT", in your test's directory.
-
- - If your test is skipped (e.g., bison not found), then the Makefile
- rule should return 2 (two). See "test-bison-nr/Makefile.in" for details.
-
- - You must modify the last few lines of tests/configure.in
- by adding your new test directory, and the Makefile target.
- (This step is done automatically by `create-test.pl`.)
-
- - Each test assumes that the newly-built binary "flex" is in the
- directory above the tests directory.
-
- - Add a description of your new test to the end of the file `descriptions'.
+ $ make test
+
+* HOW TO ADD A NEW TEST TO THE TEST SUITE
+
+**- RUN the script `create-test` found in this directory with a single
+argument of the name of the test you want to create. If it fails with
+a message about a non-existent file `config.status', then run the
+configure script in the top-level directory and everything will be
+fine. If it fails to work for you other than this, report it as a
+bug.
+
+** Modify the files in the newly created directory so that they test
+whatever feature of flex you are interested in.
+
+** On success, your test should return zero.
+
+** On error, your test should return 1 (one) and print a message to
+stderr, which will have been redirected to the file named, "OUTPUT",
+in your test's directory.
+
+** If your test is skipped (e.g., because bison was not found), then
+ the test should return 2 (two). See "test-bison-nr/Makefile.am" for
+ an example.
+
+** You must modify the last few lines of the top-level configure.in by
+ adding the Makefile for your test directory. (This step is
+ done automatically by `create-test`.)
+
+** You must add the name of your test to the SUBDIRS variable in
+ tests/Makefile.am. (This is also done automatically for you by `create-test'.)
+
+** Add a description of your new test to the end of the file
+ `descriptions'. Remember to keep the description as brief as
+ possible, preferably to one line.
+
+** You will have to run the autogen.sh script in the top-level
+ directory as well as run the configure script in that
+ directory. (Note that running config.status may prove easier or
+ quicker.)
+
+** The easiest way for you to submit your new test to the flex
+ maintainers is by generating a patch. The flex maintainers only
+ need to have the Makefile.am, the flex input file, the test input
+ file (if there is one) and any other files necessary to compile the
+ test. You do not need to submit files generated by autoconf,
+ automake, configure etc. It would be helpful to include the file
+ .cvsignore which you will find in your test directory if you used
+ the `create-test' script.
Makefile
+Makefile.in
parser.c
parser.h
scanner.c
TEMPLATE
OUTPUT
+.deps
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l parser.y test.input
+CLEANFILES = scanner.c parser.c parser.h TEMPLATE
+OBJS = scanner.o # parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = TEMPLATE
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-CXX = @CXX@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-TESTNAME = TEMPLATE
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CC) $(CFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c scanner.c
-
-parser.c: $(srcdir)/parser.y
- $(YACC) $(YFLAGS) $(srcdir)/parser.y
-
-parser.o: parser.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c parser.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-distclean: clean
- rm -f Makefile
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h parser.h $(TESTNAME) OUTPUT
-
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(TEMPLATE/parser.y)
+AC_INIT(README)
-AC_CONFIG_HEADER(config.h:config.in)
-
-dnl Checks for libraries.
-dnl Replace `main' with a function in -lpthread:
-AC_CHECK_LIB(pthread, pthread_create)
+AM_INIT_AUTOMAKE(flextestsuit, 0.1)
+AM_CONFIG_HEADER(config.h:config.in)
+AC_PROG_RANLIB
+AC_PROG_INSTALL
AC_LN_S
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CXX
-AC_PROG_RANLIB
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-AC_CONST
-AC_TYPE_SIZE_T
-AC_HEADER_STDC
-AC_HAVE_HEADERS(string.h malloc.h sys/types.h)
+
+LEX=${srcdir}/flex
+export LEX
dnl Checks for header files.
+
+AC_CONST
+AC_TYPE_SIZE_T
AC_HEADER_STDC
+AC_HAVE_HEADERS(string.h malloc.h sys/types.h unistd.h)
AC_CHECK_HEADERS(malloc.h unistd.h)
+dnl Checks for libraries.
+dnl Replace `main' with a function in -lpthread:
+
+AC_CHECK_LIB(pthread, pthread_create)
-dnl The case statement is copied from the top directory.
-case "$YACC" in
-*bison*)
- AC_ALLOCA
- ;;
-esac
-
-dnl Some of the tests may want bison, not "bison -y". We try.
-AC_CHECK_PROG(BISON,bison,bison)
-if test -z "$BISON" ; then
- BISON="$YACC"
-fi
-
-AC_SUBST(TESTDIRS)dnl
-TESTDIRS="test-string-r test-pthread \
- test-bison-yylval test-include-by-reentrant \
- TEMPLATE test-basic-nr test-basic-r \
- test-include-by-buffer test-string-nr \
- test-bison-yylloc test-yyextra test-prefix-nr \
- test-prefix-r test-header-nr test-header-r \
- test-multiple-scanners-nr test-multiple-scanners-r \
- test-array-nr test-array-r test-c-cpp-nr test-c-cpp-r"
-
-AC_OUTPUT( Makefile test-string-r/Makefile test-pthread/Makefile
- test-bison-yylval/Makefile test-include-by-reentrant/Makefile
- TEMPLATE/Makefile test-basic-nr/Makefile test-basic-r/Makefile
- test-include-by-buffer/Makefile test-string-nr/Makefile
- test-bison-yylloc/Makefile test-yyextra/Makefile
- test-prefix-nr/Makefile test-prefix-r/Makefile
- test-header-nr/Makefile test-header-r/Makefile
- test-multiple-scanners-nr/Makefile test-multiple-scanners-r/Makefile
- test-array-nr/Makefile test-array-r/Makefile test-c-cpp-nr/Makefile
- test-c-cpp-r/Makefile)
+AC_OUTPUT(
+Makefile
+TEMPLATE/Makefile
+test-array-nr/Makefile
+test-array-r/Makefile
+test-basic-nr/Makefile
+test-basic-r/Makefile
+test-bison-yylloc/Makefile
+test-bison-yylval/Makefile
+test-c-cpp-nr/Makefile
+test-c-cpp-r/Makefile
+test-header-nr/Makefile
+test-header-r/Makefile
+test-include-by-buffer/Makefile
+test-include-by-reentrant/Makefile
+test-multiple-scanners-nr/Makefile
+test-multiple-scanners-r/Makefile
+test-prefix-nr/Makefile
+test-prefix-r/Makefile
+test-pthread/Makefile
+test-string-nr/Makefile
+test-string-r/Makefile
+test-yyextra/Makefile
+)
--- /dev/null
+#!/bin/sh
+
+TESTFILES="Makefile.am scanner.l parser.y .cvsignore test.input"
+
+if [ ! $# -eq 1 ] ; then
+ exit 1
+fi
+
+mkdir $1
+for i in $TESTFILES ; do
+ cp TEMPLATE/$i $1/$i
+done
+
+sed '$i\
+tests/'"$1"'/Makefile' < ../configure.in > configure.in.tmp
+
+mv configure.in.tmp ../configure.in
+
+sed '/^SUBDIRS/a\
+ '"$1"' \\' < Makefile.am > Makefile.am.tmp
+
+mv Makefile.am.tmp Makefile.am
+
+sed "s:TEMPLATE:$1:g" < "$1"/Makefile.am > "$1"/Makefile.am.tmp
+mv "$1"/Makefile.am.tmp "$1"/Makefile.am
+++ /dev/null
-#! /usr/bin/env perl
-# vim:set autoindent smartindent expandtab tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0:
-# Author and scapegoat if this breaks: Millaway
-use Fcntl qw(:seek);
-use File::Copy;
-use strict;
-$^W = 1; # same as perl -w
-my $USAGE = q{
- Usage:
- create-test.pl [-p] [-+] TEST_NAME
-
- Creates a new flex test named "TEST_NAME" in the directory
- TEST_NAME/. Modifies configure.in.
-
- OPTIONS:
-
- -p include a skeleton bison parser
- -+ make a C++ scanner
-
-};
-sub abort { print shift,"\n"; exit 1}
-
-my $skel= "TEMPLATE";
-my $testname = undef;
-my ($parser,$cplusplus) = (0,0);
-
-while(defined ($_=shift)){
- /^-p$/ && do{ $parser = 1; next};
- /^-\+$/ && do{ $cplusplus = 1; next};
- /^-/ && abort "$0: Unrecognized option '$_'.\n$USAGE";
- $testname = $_;
- last;
-}
-
-abort($USAGE) unless @ARGV == 0 && defined $testname;
-
-# Some simple safe-guards.
-$testname =~ m/^test-\w+/ or abort "Testname must begin with 'test-'. Aborting.";
--e $testname and abort "File '$testname' already exists. Refusing to overwrite.";
--e $skel && -d $skel or abort "Can't find directory '$skel/'. Aborting.";
-
-# create the test dir
-print "mkdir $testname\n";
-mkdir $testname or abort "Unable to create directory '$testname/': $!";
-
-# shallow copy the skeleton directory, replacing special keywords here and there.
-opendir SKEL, $skel or abort "Could not read directory $skel: $!";
-
-foreach my $file ( grep { !/^\.+$/ && -f "$skel/$_" } readdir SKEL ){
-
- next if $file eq 'parser.y' && !$parser;
-
- print "cp $skel/$file $testname/$file\n";
- open IN, "< $skel/$file" or abort "Unable to read file $skel/$file: $!";
- open OUT, "> $testname/$file" or abort "Unable to write file $testname/$file: $!";
- my $did_cpp_option=0;
- my $did_parser_objs=0;
-
- while(<IN>){
- s/\bTEMPLATE\b/$testname/g;
-
- # add %option c++
- $cplusplus
- && /^\%option\s+.+$/
- && !$did_cpp_option
- && do { $_ .= "\%option c++\n"; $did_cpp_option=1 };
-
- $cplusplus && s/scanner\.c/scanner\.cc/g;
-
- # change $(CC) to $(CXX)
- BEGIN{ $::CC = qr/^(?<=\t)\$\(CC\)/;
- $::CXX = quotemeta '$(CXX)';
- }
- $cplusplus && s/$::CC/$::CXX/o;
-
- # fix the makefile to include the parser.
- $parser
- && !$did_parser_objs
- && s/^(OBJS\s*=\s*scanner\.o)/$1 parser.o/
- && ($did_parser_objs=1);
-
- print OUT;
- }
-
- close IN;
- close OUT;
-}
-closedir SKEL;
-
-if (-e "$testname/cvsignore" ){
- print "mv $testname/cvsignore $testname/.cvsignore...\n";
- move("$testname/cvsignore", "$testname/.cvsignore")
- or abort "Could not rename $testname/.cvsignore";
-}
-
-# modify configure.in...
-print "Modifying configure.in (appending to TESTDIRS and AC_OUTPUT)...\n";
-
-# We slurp it all into memory. We can do this because configure.in is small.
-# If we move the tests/ dir to automake then revisit this.
-open CONF, "+< configure.in" or abort "Could not read 'configure.in': $!";
-my $entire_conf = do{ local $/; <CONF> };
-
-# - Add test-directory to "TESTDIRS" variable
-# This is complex because we append to it, we avoid creating long lines, and we
-# preserve indenting. Hey, that's what perl is for.
-# Otherwise we could just do: s/TESTDIRS="/$&$testname /;
-$entire_conf =~ s/(TESTDIRS\s*=\s*".+) # (everything up to last line)
- ^(\s*)((?:test-[\w-]+\s*)+)" # (indenting)(last line)
- /length("$2$3$testname") > 80
- ? qq($1$2$3 \\\n$2$testname")
- : qq($1$2$3 $testname")
- /xmsge;
-
-
-# - Add test-directory/Makefile to "AC_OUTPUT" variable
-# This is complex. See above.
-$entire_conf =~ s/(AC_OUTPUT\s*\(.+) # (everything up to last line)
- ^(\s*)((?:test-[\w-]+\/Makefile\s*)+)\) # (indenting)(last line)
- /length("$2$3$testname\/Makefile") > 80
- ? "$1$2$3 \\\n$2$testname\/Makefile)"
- : "$1$2$3 $testname\/Makefile)"
- /xmsge;
-
-# rewind the file and save the changes
-seek CONF, 0, SEEK_SET;
-print CONF $entire_conf;
-close CONF;
-
-print <<MSG;
-
-*********************************************************************
-"$testname/" has been created. It contains a generic test.
-Now you must:
- 1. Edit "$testname/scanner.@{[$cplusplus?'cc':'c']}" to customize your test.
- 2. Make an entry in the README, describing your test.
- 3. Run 'autoconf' to rebuild 'configure'.
-*********************************************************************
-
-MSG
-
-__END__
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l test.input
+CLEANFILES = scanner.c parser.c parser.h test-array-nr
+OBJS = scanner.o # parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = test-array-nr
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-TESTNAME = test-array-nr
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o # parser.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CC) $(CFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c scanner.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-distclean: clean
- rm -f Makefile
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h parser.h $(TESTNAME) OUTPUT
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l test.input
+ CLEANFILES = scanner.c test-array-r
+OBJS = scanner.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = test-array-r
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-TESTNAME = test-array-r
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o # parser.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CC) $(CFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c scanner.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-distclean: clean
- rm -f Makefile
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h parser.h $(TESTNAME) OUTPUT
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l test.input
+CLEANFILES = scanner.c parser.c parser.h test-basic-nr
+OBJS = scanner.o # parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = test-basic-nr
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o # parser.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-TESTNAME = test-basic-nr
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CC) $(CFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c scanner.c
-
-parser.c: $(srcdir)/parser.y
- $(YACC) $(YFLAGS) $(srcdir)/parser.y
-
-parser.o: parser.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c parser.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h $(TESTNAME)
-
-
-distclean: clean
- rm -f Makefile
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l test.input
+CLEANFILES = scanner.c parser.c parser.h test-basic-r
+OBJS = scanner.o # parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = test-basic-r
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o # parser.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-TESTNAME = test-basic-r
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CC) $(CFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c scanner.c
-
-parser.c: $(srcdir)/parser.y
- $(YACC) $(YFLAGS) $(srcdir)/parser.y
-
-parser.o: parser.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c parser.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h $(TESTNAME)
-
-
-distclean: clean
- rm -f Makefile
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l parser.y test.input
+CLEANFILES = scanner.c parser.c parser.h test-bison-yylloc
+OBJS = scanner.o parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+YFLAGS = --defines --output=parser.c --name-prefix="test"
+
+testname = test-bison-yylloc
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-TESTNAME = test-bison-yylloc
-all: $(TESTNAME)
-
-$(TESTNAME): parser.y scanner.l
- if test "$(YACC)" = "bison" ; then \
- $(FLEX) $(srcdir)/scanner.l ; \
- $(YACC) $(YFLAGS) $(srcdir)/parser.y ; \
- $(CC) $(CPPFLAGS) $(CFLAGS) -c scanner.c ; \
- $(CC) $(CPPFLAGS) $(CFLAGS) -c parser.c ; \
- $(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/main.c ; \
- $(CC) $(CFLAGS) -o $(TESTNAME) scanner.o parser.o main.o $(LDFLAGS) $(LIBS) ; \
- fi
-
-test: check
-
-check: $(TESTNAME)
- if test "$(YACC)" = "bison" ; then \
- { ./$(TESTNAME) <$(srcdir)/test.input | ./$(TESTNAME) | \
- diff $(srcdir)/test.input - ; } ; \
- else \
- echo "Test skipped because GNU bison was not detected by configure." ; \
- exit 2;\
- fi
-
-clean:
- rm -f scanner.o scanner.c main.o parser.o parser.c parser.h $(TESTNAME) yyheader.h
-
-
-distclean: clean
- rm -f Makefile
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l parser.y test.input
+OBJS = $(srcdir)/scanner.o # $(srcdir)/parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = test-c-cpp-nr
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CXX) -o $(testname)$(EXEEXT) $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-CXX = @CXX@
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-TESTNAME = test-c-cpp-nr
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o # parser.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CXX) $(CFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CXX) $(CPPFLAGS) $(CFLAGS) -c scanner.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-distclean: clean
- rm -f Makefile
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h parser.h $(TESTNAME) OUTPUT
-
--- /dev/null
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l parser.y test.input
+CLEANFILES = scanner.c parser.c parser.h test-c-cpp-r
+OBJS = scanner.o # parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)/tests
+#LDFLAGS = $(top_srcdir)/libfl.a
+#YFLAGS = --defines --output=parser.c
+
+testname = test-c-cpp-r
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $<
+
+parser.c: $(srcdir)/parser.y
+ $(BISON) $(YFLAGS) $<
+
+$(testname)$(EXEEXT): $(OBJS)
+ $(CXX) -o $@ $(OBJS) $(LDFLAGS)
+
+test: $(testname)$(EXEEXT)
+ $(srcdir)/$(testname)$(EXEEXT) < $(srcdir)/test.input
+
+.c.o:
+ $(CC) -c -o $@ $(INCLUDES) $<
+++ /dev/null
-# Makefile.in for a single TEST.
-#
-# By default this Makefile will build the target "$(TESTNAME)"
-# from the sources "scanner.l" and "parser.y".
-#
-# $(TESTNAME) is supplied by the calling Makefile.
-# "parser.y" is not necessary. You may delete this file
-# if you do not require a parser.
-# "scanner.l" is necessary. It should build "scanner.c".
-#
-
-@SET_MAKE@
-
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I"@srcdir@" -I..
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-SHELL = /bin/sh
-srcdir = @srcdir@
-VPATH = @srcdir@
-LN_S = @LN_S@
-YACC = @YACC@
-CC = @CC@
-CXX = @CXX@
-CXXFLAGS = @CXXFLAGS@ -I. -I"@srcdir@" -I..
-AR = ar
-RANLIB = @RANLIB@
-YACC = @YACC@
-
-# Edit these if necessary for your specific test.
-TESTNAME = test-c-cpp-r
-FLEX = ../../flex
-YFLAGS = --defines --output-file="parser.c" --name-prefix="test"
-OBJS = scanner.o # parser.o
-
-# Force YACC to be bison (autoconf generates 'bison -y')
-YACC = @BISON@
-
-all: $(TESTNAME)
-
-$(TESTNAME): $(OBJS)
- $(CXX) $(CXXFLAGS) -o $(TESTNAME) $(OBJS) $(LDFLAGS) $(LIBS)
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $(srcdir)/scanner.l
-
-scanner.o: scanner.c
- $(CXX) $(CXXFLAGS) -c scanner.c
-
-test: check
-
-check: $(TESTNAME)
- ./$(TESTNAME) < $(srcdir)/test.input
-
-distclean: clean
- rm -f Makefile
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h parser.h $(TESTNAME) OUTPUT
-