Commit | Line | Data |
---|---|---|
828c373b | 1 | ## Process this file with automake to produce Makefile.in -*-Makefile-*- |
7d424de1 | 2 | |
34136e65 | 3 | ## Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc. |
828c373b | 4 | |
f16b0819 PE |
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. | |
9 | # | |
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. | |
14 | # | |
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/>. | |
828c373b | 17 | |
2191bb74 AD |
18 | ## ------------------- ## |
19 | ## Parser generation. ## | |
20 | ## ------------------- ## | |
828c373b | 21 | |
59fba180 | 22 | CLEANFILES += examples/calc++/calc++-parser.output *.tmp |
2191bb74 | 23 | |
2191bb74 AD |
24 | # Don't depend on $(BISON) otherwise we would rebuild these files |
25 | # in srcdir, including during distcheck, which is forbidden. | |
59fba180 AD |
26 | examples/calc++/calc++-parser.stamp: $(BISON_IN) |
27 | SUFFIXES += .yy .stamp | |
28 | .yy.stamp: | |
2191bb74 | 29 | $(AM_V_YACC)rm -f $@ |
f67c0a1c | 30 | $(AM_V_at)touch $@.tmp |
59fba180 | 31 | $(AM_V_at)$(YACCCOMPILE) -o $*.cc $< |
2191bb74 AD |
32 | $(AM_V_at)mv -f $@.tmp $@ |
33 | ||
34 | $(calc_sources_generated): examples/calc++/calc++-parser.stamp | |
35 | @test -f $@ || rm -f examples/calc++/calc++-parser.stamp | |
36 | @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp | |
828c373b | 37 | |
94306d52 | 38 | |
2e4986a8 AD |
39 | ## -------------------- ## |
40 | ## Building & testing. ## | |
41 | ## -------------------- ## | |
828c373b | 42 | |
2191bb74 AD |
43 | # Avoid using BUILT_SOURCES which is too global. |
44 | $(examples_calc___calc___OBJECTS): $(calc_sources_generated) | |
609b3d80 | 45 | |
2191bb74 | 46 | calc_sources_extracted = \ |
609b3d80 | 47 | examples/calc++/calc++-driver.cc \ |
2191bb74 AD |
48 | examples/calc++/calc++-driver.hh \ |
49 | examples/calc++/calc++-scanner.ll \ | |
50 | examples/calc++/calc++.cc | |
51 | calc_extracted = \ | |
52 | $(calc_sources_extracted) \ | |
360ae94e | 53 | examples/calc++/calc++-parser.yy |
2191bb74 AD |
54 | extracted += $(calc_extracted) |
55 | calc_sources_generated = \ | |
56 | examples/calc++/calc++-parser.cc \ | |
57 | examples/calc++/calc++-parser.hh \ | |
58 | examples/calc++/location.hh \ | |
360ae94e | 59 | examples/calc++/position.hh \ |
2191bb74 | 60 | examples/calc++/stack.hh |
609b3d80 | 61 | calc_sources = \ |
2191bb74 AD |
62 | $(calc_sources_extracted) \ |
63 | $(calc_sources_generated) | |
59fba180 | 64 | |
360ae94e | 65 | if BISON_CXX_WORKS |
2e4986a8 | 66 | check_PROGRAMS += examples/calc++/calc++ |
59fba180 | 67 | nodist_examples_calc___calc___SOURCES = \ |
2191bb74 | 68 | $(calc_sources) |
609b3d80 | 69 | |
59fba180 AD |
70 | examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++ |
71 | dist_TESTS += examples/calc++/calc++.test | |
360ae94e | 72 | endif |