summaryrefslogtreecommitdiff
path: root/tests/test-yyextra
diff options
context:
space:
mode:
authorwlestes <wlestes>2002-04-12 16:02:21 +0000
committerwlestes <wlestes>2002-04-12 16:02:21 +0000
commit9c6adaca493e0cd3da08eb4b4e1ae7263bf90048 (patch)
tree39e44d6ffa3b705c848550036fef31112f22be79 /tests/test-yyextra
parent11e031e9ea1400de9b589cbbdfee859937b1fdb9 (diff)
downloadflex-9c6adaca493e0cd3da08eb4b4e1ae7263bf90048.tar.gz
put test-yyextra under automake
Diffstat (limited to 'tests/test-yyextra')
-rw-r--r--tests/test-yyextra/Makefile.am28
-rw-r--r--tests/test-yyextra/Makefile.in66
2 files changed, 28 insertions, 66 deletions
diff --git a/tests/test-yyextra/Makefile.am b/tests/test-yyextra/Makefile.am
new file mode 100644
index 0000000..d557873
--- /dev/null
+++ b/tests/test-yyextra/Makefile.am
@@ -0,0 +1,28 @@
+BISON = @BISON@
+FLEX = $(top_builddir)/flex
+
+EXTRA_DIST = scanner.l parser.y test.input
+CLEANFILES = scanner.c scanner.h parser.c parser.h test-yyextra OUTPUT $(OBJS)
+OBJS = scanner.o # parser.o
+
+INCLUDES = -I $(srcdir) -I $(top_srcdir)
+#LDFLAGS = $(top_srcdir)/libfl.a
+#LFLAGS = --header="scanner.h"
+#YFLAGS = --defines --output=parser.c
+
+testname = test-yyextra
+
+scanner.c: $(srcdir)/scanner.l
+ $(FLEX) $(LFLAGS) $<
+
+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) $<
diff --git a/tests/test-yyextra/Makefile.in b/tests/test-yyextra/Makefile.in
deleted file mode 100644
index f42d8cd..0000000
--- a/tests/test-yyextra/Makefile.in
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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-yyextra
-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 | \
- diff $(srcdir)/test.input -
-
-distclean: clean
- rm -f Makefile
-
-clean:
- rm -f scanner.o scanner.c parser.o parser.c parser.h parser.h $(TESTNAME)
-