1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
3 ## Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ## ------------------------------------- ##
19 ## Running the bison from this tarball. ##
20 ## ------------------------------------- ##
22 BISON = $(top_builddir)/tests/bison
23 BISON_IN = $(top_srcdir)/tests/bison.in
26 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) tests/bison
32 doc = $(top_srcdir)/doc/bison.texinfo
33 extexi = $(top_srcdir)/examples/extexi
35 $(srcdir)/calc.stamp: $(doc) $(extexi)
39 $(AWK) -f ../extexi -v VERSION="$(VERSION)" \
40 ../../doc/bison.texinfo -- calc++-parser.yy \
41 calc++-scanner.ll calc++.cc calc++-driver.hh calc++-driver.cc
44 $(calc_extracted): $(srcdir)/calc.stamp
46 ## ------------------- ##
47 ## Parser generation. ##
48 ## ------------------- ##
50 DEFAULT_INCLUDES = -I. -I$(srcdir)
51 BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
52 CLEANFILES = $(srcdir)/*.output *.tmp
53 MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
55 # Compile the parser and save cycles.
56 # This code comes from "Handling Tools that Produce Many Outputs",
57 # from the Automake documentation.
59 $(srcdir)/calc++-parser.stamp \
60 $(srcdir)/calc++-parser.yy \
62 # Don't depend on $(BISON) otherwise we would rebuild these files
63 # in srcdir, including during distcheck, which is forbidden.
64 $(srcdir)/calc++-parser.stamp: $(srcdir)/calc++-parser.yy $(BISON_IN)
65 @rm -f calc++-parser.tmp
66 @touch calc++-parser.tmp
67 $(BISON) -d -ra -o $(srcdir)/calc++-parser.cc \
68 $(srcdir)/calc++-parser.yy
69 @mv -f calc++-parser.tmp $@
71 $(calc_sources_generated): $(srcdir)/calc++-parser.stamp
72 @if test -f $@; then :; else \
73 rm -f $(srcdir)/calc++-parser.stamp && \
74 $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/calc++-parser.stamp; \
78 ## --------------------------- ##
79 ## Building & testing calc++. ##
80 ## --------------------------- ##
82 check_PROGRAMS = calc++
84 calc_sources_extracted = $(srcdir)/calc++-scanner.ll $(srcdir)/calc++.cc \
85 $(srcdir)/calc++-driver.hh $(srcdir)/calc++-driver.cc
86 calc_extracted = $(calc_sources_extracted) $(srcdir)/calc++-parser.yy
87 calc_sources_generated = \
88 $(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
89 $(srcdir)/calc++-parser.hh $(srcdir)/calc++-parser.cc
91 calc___SOURCES = $(calc_sources_extracted) $(calc_sources_generated)
94 EXTRA_DIST += $(TESTS)