]> git.saurik.com Git - bison.git/blame - examples/calc++/Makefile.am
Fix C++ test cases after recent Gnulib changes. Discussed starting at
[bison.git] / examples / calc++ / Makefile.am
CommitLineData
828c373b 1## Process this file with automake to produce Makefile.in -*-Makefile-*-
6fc0c024 2## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
828c373b
AD
3
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 2 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, write to the Free Software
16## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17## 02110-1301 USA
18
19## ------------------------------------- ##
20## Running the bison from this tarball. ##
21## ------------------------------------- ##
22
23BISON = $(top_builddir)/tests/bison
24BISON_IN = $(top_srcdir)/tests/bison.in
25
26$(BISON): $(BISON_IN)
27 cd $(top_builddir)/tests && $(MAKE) $(AM_MAKEFLAGS) bison
28
29## ------------ ##
30## Extracting. ##
31## ------------ ##
32
33doc = $(top_srcdir)/doc/bison.texinfo
34extexi = $(top_srcdir)/examples/extexi
828c373b 35# Extract in src.
b34d96c1 36$(calc_extracted): $(doc) $(extexi)
828c373b 37 cd $(srcdir) && \
e6e704dc 38 $(AWK) -f ../extexi -v VERSION="$(VERSION)" \
0e021770 39 ../../doc/bison.texinfo -- calc++-parser.yy \
828c373b
AD
40 calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
41
42
43## ------------------- ##
44## Parser generation. ##
45## ------------------- ##
46
ce3448d5 47DEFAULT_INCLUDES = -I. -I$(srcdir)
b34d96c1
PE
48BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
49CLEANFILES = $(srcdir)/*.output *.tmp
50MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
828c373b
AD
51
52# Compile the parser and save cycles.
53# This code comes from "Handling Tools that Produce Many Outputs",
54# from the Automake documentation.
55EXTRA_DIST = $(srcdir)/calc++-parser.stamp $(srcdir)/calc++-parser.yy
56# Don't depend on $(BISON) otherwise we would rebuild these files
57# in srcdir, including during distcheck, which is forbidden.
58$(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
59 @rm -f calc++-parser.tmp
60 @touch calc++-parser.tmp
b34d96c1
PE
61 $(BISON) -d -ra -S lalr1.cc -o $(srcdir)/calc++-parser.cc \
62 $(srcdir)/calc++-parser.yy
828c373b
AD
63 @mv -f calc++-parser.tmp $@
64
65$(calc_sources_generated): $(srcdir)/calc++-parser.stamp
94306d52
PE
66 @if test -f $@; then :; else \
67 rm -f $(srcdir)/calc++-parser.stamp && \
68 $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
69 fi
70
828c373b
AD
71
72## --------------------------- ##
73## Building & testing calc++. ##
74## --------------------------- ##
75
6fc0c024 76check_PROGRAMS = calc++
828c373b
AD
77
78calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
b34d96c1
PE
79 $(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
80calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
828c373b
AD
81calc_sources_generated = \
82 $(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
83 $(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
84
85calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
86
87TESTS = test
88EXTRA_DIST += $(TESTS)