]> git.saurik.com Git - bison.git/blame - examples/calc++/local.mk
build: ship all the files, even if the C++ compiler is broken
[bison.git] / examples / calc++ / local.mk
CommitLineData
7d6bad19 1# Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
2a559307 2#
f16b0819
PE
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.
7#
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.
12#
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/>.
828c373b 15
2191bb74
AD
16## ------------------- ##
17## Parser generation. ##
18## ------------------- ##
828c373b 19
2191bb74
AD
20# Don't depend on $(BISON) otherwise we would rebuild these files
21# in srcdir, including during distcheck, which is forbidden.
59fba180
AD
22examples/calc++/calc++-parser.stamp: $(BISON_IN)
23SUFFIXES += .yy .stamp
24.yy.stamp:
2191bb74 25 $(AM_V_YACC)rm -f $@
f67c0a1c 26 $(AM_V_at)touch $@.tmp
59fba180 27 $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
2191bb74
AD
28 $(AM_V_at)mv -f $@.tmp $@
29
30$(calc_sources_generated): examples/calc++/calc++-parser.stamp
31 @test -f $@ || rm -f examples/calc++/calc++-parser.stamp
32 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
9fd33c2b
AD
33CLEANFILES += \
34 $(calc_sources_generated) \
35 examples/calc++/calc++-parser.output \
36 examples/calc++/calc++-parser.stamp \
fca5693b 37 examples/calc++/calc++-scanner.cc
828c373b 38
94306d52 39
2e4986a8
AD
40## -------------------- ##
41## Building & testing. ##
42## -------------------- ##
828c373b 43
2191bb74
AD
44# Avoid using BUILT_SOURCES which is too global.
45$(examples_calc___calc___OBJECTS): $(calc_sources_generated)
609b3d80 46
5ae8eb32
AD
47calc_sources_extracted = \
48 examples/calc++/calc++-driver.cc \
49 examples/calc++/calc++-driver.hh \
50 examples/calc++/calc++-scanner.ll \
2191bb74 51 examples/calc++/calc++.cc
5ae8eb32
AD
52calc_extracted = \
53 $(calc_sources_extracted) \
360ae94e 54 examples/calc++/calc++-parser.yy
2191bb74 55extracted += $(calc_extracted)
5ae8eb32
AD
56calc_sources_generated = \
57 examples/calc++/calc++-parser.cc \
58 examples/calc++/calc++-parser.hh \
59 examples/calc++/location.hh \
60 examples/calc++/position.hh \
2191bb74 61 examples/calc++/stack.hh
5ae8eb32
AD
62calc_sources = \
63 $(calc_sources_extracted) \
2191bb74 64 $(calc_sources_generated)
59fba180 65
360ae94e 66if BISON_CXX_WORKS
2e4986a8 67check_PROGRAMS += examples/calc++/calc++
5ae8eb32 68nodist_examples_calc___calc___SOURCES = \
2191bb74 69 $(calc_sources)
609b3d80 70
59fba180 71examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
5ae8eb32 72examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
59fba180 73dist_TESTS += examples/calc++/calc++.test
0fcc2e9a
AD
74else
75EXTRA_DIST += examples/calc++/calc++.test
360ae94e 76endif