1 # Copyright (C) 2005-2006, 2008-2013 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 # Don't depend on $(BISON) otherwise we would rebuild these files
21 # in srcdir, including during distcheck, which is forbidden.
22 %D%/calc++-parser.stamp: $(BISON_IN)
23 SUFFIXES += .yy .stamp
26 $(AM_V_at)touch $@.tmp
27 $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
28 $(AM_V_at)mv -f $@.tmp $@
30 $(calc_sources_generated): %D%/calc++-parser.stamp
31 @test -f $@ || rm -f %D%/calc++-parser.stamp
32 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/calc++-parser.stamp
34 $(calc_sources_generated) \
35 %D%/calc++-parser.output \
36 %D%/calc++-parser.stamp \
40 ## -------------------- ##
41 ## Building & testing. ##
42 ## -------------------- ##
44 # Avoid using BUILT_SOURCES which is too global.
45 $(%C%_calc___OBJECTS): $(calc_sources_generated)
47 calc_sources_extracted = \
48 %D%/calc++-driver.cc \
49 %D%/calc++-driver.hh \
50 %D%/calc++-scanner.ll \
53 $(calc_sources_extracted) \
55 extracted += $(calc_extracted)
56 calc_sources_generated = \
57 %D%/calc++-parser.cc \
58 %D%/calc++-parser.hh \
63 $(calc_sources_extracted) \
64 $(calc_sources_generated)
67 check_PROGRAMS += %D%/calc++
68 nodist_%C%_calc___SOURCES = \
71 %C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
72 %C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
73 dist_TESTS += %D%/calc++.test
75 EXTRA_DIST += %D%/calc++.test