]> git.saurik.com Git - bison.git/blame - examples/calc++/Makefile.am
tests: use the generalized default yylex.
[bison.git] / examples / calc++ / Makefile.am
CommitLineData
828c373b 1## Process this file with automake to produce Makefile.in -*-Makefile-*-
c932d613 2## Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
828c373b 3
f16b0819
PE
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
828c373b
AD
16
17## ------------------------------------- ##
18## Running the bison from this tarball. ##
19## ------------------------------------- ##
20
21BISON = $(top_builddir)/tests/bison
22BISON_IN = $(top_srcdir)/tests/bison.in
23
24$(BISON): $(BISON_IN)
08023564 25 $(AM_V_GEN)cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
828c373b
AD
26
27## ------------ ##
28## Extracting. ##
29## ------------ ##
30
9bcffa0c 31doc = $(top_srcdir)/doc/bison.texi
828c373b 32extexi = $(top_srcdir)/examples/extexi
828c373b 33# Extract in src.
bfa018d4 34$(srcdir)/calc.stamp: $(doc) $(extexi)
08023564
AD
35 $(AM_V_GEN)rm -f $@ $@.tmp
36 $(AM_V_at)touch $@.tmp
37 $(AM_V_at)cd $(srcdir) && \
e6e704dc 38 $(AWK) -f ../extexi -v VERSION="$(VERSION)" \
9bcffa0c 39 ../../doc/bison.texi -- calc++-parser.yy \
828c373b 40 calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
08023564 41 $(AM_V_at)mv $@.tmp $@
828c373b 42
bfa018d4 43$(calc_extracted): $(srcdir)/calc.stamp
828c373b
AD
44
45## ------------------- ##
46## Parser generation. ##
47## ------------------- ##
48
ce3448d5 49DEFAULT_INCLUDES = -I. -I$(srcdir)
b34d96c1
PE
50BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
51CLEANFILES = $(srcdir)/*.output *.tmp
52MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
828c373b
AD
53
54# Compile the parser and save cycles.
55# This code comes from "Handling Tools that Produce Many Outputs",
56# from the Automake documentation.
47076da5
AD
57EXTRA_DIST = \
58 $(srcdir)/calc++-parser.stamp \
59 $(srcdir)/calc++-parser.yy \
60 $(srcdir)/calc.stamp
828c373b
AD
61# Don't depend on $(BISON) otherwise we would rebuild these files
62# in srcdir, including during distcheck, which is forbidden.
63$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
08023564
AD
64 $(AM_V_GEN)rm -f calc++-parser.tmp
65 $(AM_V_at)touch calc++-parser.tmp
66 $(AM_V_at)$(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
b34d96c1 67 $(srcdir)/calc++-parser.yy
08023564 68 $(AM_V_at)mv -f calc++-parser.tmp $@
828c373b
AD
69
70$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
08023564 71 $(AM_V_GEN)if test -f $@; then :; else \
94306d52
PE
72 rm -f $(srcdir)/calc++-parser.stamp && \
73 $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
74 fi
75
828c373b
AD
76
77## --------------------------- ##
78## Building & testing calc++. ##
79## --------------------------- ##
80
6fc0c024 81check_PROGRAMS = calc++
828c373b
AD
82
83calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
08023564 84 $(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
b34d96c1 85calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
828c373b 86calc_sources_generated = \
08023564
AD
87 $(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
88 $(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
828c373b
AD
89
90calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
91
92TESTS = test
93EXTRA_DIST += $(TESTS)