]> git.saurik.com Git - bison.git/blame - examples/calc++/local.mk
package: bump to 2014
[bison.git] / examples / calc++ / local.mk
CommitLineData
fc51acdd 1# Copyright (C) 2005-2006, 2008-2014 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.
afc44576 22%D%/calc++-parser.stamp: $(BISON_IN)
59fba180
AD
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
b167e7ba 30$(calcxx_sources_generated): %D%/calc++-parser.stamp
afc44576
AD
31 @test -f $@ || rm -f %D%/calc++-parser.stamp
32 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/calc++-parser.stamp
9fd33c2b 33CLEANFILES += \
b167e7ba 34 $(calcxx_sources_generated) \
afc44576
AD
35 %D%/calc++-parser.output \
36 %D%/calc++-parser.stamp \
37 %D%/calc++-scanner.cc
828c373b 38
94306d52 39
2e4986a8
AD
40## -------------------- ##
41## Building & testing. ##
42## -------------------- ##
828c373b 43
2191bb74 44# Avoid using BUILT_SOURCES which is too global.
b167e7ba 45$(%C%_calc___OBJECTS): $(calcxx_sources_generated)
609b3d80 46
b167e7ba 47calcxx_sources_extracted = \
afc44576
AD
48 %D%/calc++-driver.cc \
49 %D%/calc++-driver.hh \
50 %D%/calc++-scanner.ll \
51 %D%/calc++.cc
b167e7ba
AD
52calcxx_extracted = \
53 $(calcxx_sources_extracted) \
afc44576 54 %D%/calc++-parser.yy
b167e7ba
AD
55extracted += $(calcxx_extracted)
56calcxx_sources_generated = \
afc44576
AD
57 %D%/calc++-parser.cc \
58 %D%/calc++-parser.hh \
59 %D%/location.hh \
60 %D%/position.hh \
61 %D%/stack.hh
b167e7ba
AD
62calcxx_sources = \
63 $(calcxx_sources_extracted) \
64 $(calcxx_sources_generated)
59fba180 65
3a684d61 66if FLEX_CXX_WORKS
afc44576
AD
67check_PROGRAMS += %D%/calc++
68nodist_%C%_calc___SOURCES = \
b167e7ba 69 $(calcxx_sources)
609b3d80 70
afc44576
AD
71%C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
72%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
73dist_TESTS += %D%/calc++.test
0fcc2e9a 74else
afc44576 75EXTRA_DIST += %D%/calc++.test
360ae94e 76endif
b167e7ba
AD
77
78
79## ------------ ##
80## Installing. ##
81## ------------ ##
82
83calcxxdir = $(docdir)/examples/calc++
84calcxx_DATA = $(calcxx_extracted)