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