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