1 # Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ## ------------------- ##
17 ## Parser generation. ##
18 ## ------------------- ##
20 CLEANFILES += examples/calc++/calc++-parser.output *.tmp
22 # Don't depend on $(BISON) otherwise we would rebuild these files
23 # in srcdir, including during distcheck, which is forbidden.
24 examples/calc++/calc++-parser.stamp: $(BISON_IN)
25 SUFFIXES += .yy .stamp
28 $(AM_V_at)touch $@.tmp
29 $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
30 $(AM_V_at)mv -f $@.tmp $@
32 $(calc_sources_generated): examples/calc++/calc++-parser.stamp
33 @test -f $@ || rm -f examples/calc++/calc++-parser.stamp
34 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
37 ## -------------------- ##
38 ## Building & testing. ##
39 ## -------------------- ##
41 # Avoid using BUILT_SOURCES which is too global.
42 $(examples_calc___calc___OBJECTS): $(calc_sources_generated)
44 calc_sources_extracted = \
45 examples/calc++/calc++-driver.cc \
46 examples/calc++/calc++-driver.hh \
47 examples/calc++/calc++-scanner.ll \
48 examples/calc++/calc++.cc
50 $(calc_sources_extracted) \
51 examples/calc++/calc++-parser.yy
52 extracted += $(calc_extracted)
53 calc_sources_generated = \
54 examples/calc++/calc++-parser.cc \
55 examples/calc++/calc++-parser.hh \
56 examples/calc++/location.hh \
57 examples/calc++/position.hh \
58 examples/calc++/stack.hh
60 $(calc_sources_extracted) \
61 $(calc_sources_generated)
64 check_PROGRAMS += examples/calc++/calc++
65 nodist_examples_calc___calc___SOURCES = \
68 examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
69 dist_TESTS += examples/calc++/calc++.test