LOG_COMPILER = $(srcdir)/testwrapper.sh
AM_LOG_FLAGS = $(srcdir)
+AM_YFLAGS = -d -p test
+
check_PROGRAMS = \
alloc-extra \
array-nr \
array-r \
basic-nr \
- basic-r
+ basic-r \
+ bison-nr
alloc_extra_SOURCES = alloc-extra.l
array_nr_SOURCES = array-nr.l
array_r_SOURCES = array-r.l
basic_nr_SOURCES = basic-nr.l
basic_r_SOURCES = basic-r.l
+bison_nr_SOURCES = bison-nr-scanner.l bison-nr-parser.y bison-nr-main.c
+
+BUILT_SOURCES = \
+ bison-nr-scanner.h \
+ bison-nr-parser.h
EXTRA_DIST = \
README \
array-nr.txt \
array-r.txt \
basic-nr.txt \
- basic-r.txt
+ basic-r.txt \
+ bison-nr-scanner.h \
+ bison-nr.txt
# specify how to process .l files in order to test the flex built by make all
.l.c:
$(FLEX) -o $@ $<
+
+bison-nr-main($objext): bison-nr-parser.h bison-nr-scanner.h
+bison-nr-scanner.h: bison-nr-scanner.c
/* The scanner expects to link to bison yylval . */
#include <stdio.h>
#include <stdlib.h>
-#include "parser.h"
+#include "bison-nr-parser.h"
#include "config.h"
static char* STRDUP(char* s1);
#define YY_EXTRA_TYPE int
%}
-%option 8bit outfile="scanner.c" prefix="test"
+%option 8bit prefix="test"
%option bison-locations yylineno
%option nomain nounput noyy_top_state noyywrap nodefault warn
-%option prefix="test" header="scanner.h" yylineno
+%option prefix="test" header="bison-nr-scanner.h" yylineno
%%
+++ /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.
-
-
-FLEX = $(top_builddir)/flex
-
-builddir = @builddir@
-
-EXTRA_DIST = scanner.l parser.y test.input main.c
-CLEANFILES = scanner.c scanner.h parser.c parser.h $(testname)$(EXEEXT) $(OBJS) OUTPUT
-OBJS = scanner.o parser.o main.o
-
-AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_builddir) -I$(builddir)
-#LDFLAGS = $(top_srcdir)/libfl.a
-YFLAGS = --defines --output=parser.c --name-prefix="test"
-
-testname = test-bison-nr
-
-scanner.c: $(srcdir)/scanner.l
- $(FLEX) $<
-scanner.h: scanner.c
-scanner.o: parser.h
-
-parser.c: $(srcdir)/parser.y
- $(BISON) $(YFLAGS) $<
-parser.h: parser.c
-
-main.o: scanner.h parser.h
-
-$(testname)$(EXEEXT): $(OBJS)
- $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LOADLIBES)
-
-test: $(testname)$(EXEEXT)
- ./$(testname)$(EXEEXT) < $(srcdir)/test.input
-
-.c.o:
- $(CC) -c -o $@ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $<