summaryrefslogtreecommitdiff
path: root/tests/test-yyextra/Makefile.in
blob: f42d8cd369adecc002acc57831c781936ea2a45c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 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)