Files
bison/examples/mfcalc/local.mk
Akim Demaille 2191bb749b maint: fix example extraction issues.
calc++: don't rely on Automake to compile a C++ parser.

Basically, revert commit 609b3d8096,
Automake 1.11.3 is not safe enough for C++ parser.

	* examples/calc++/calc++-parser.hh: Remove.
	* examples/calc++/local.mk (examples/calc++/calc++-parser.stamp):
	New.

examples: factor the extractions into a single step

extexi had to be run in the extraction directory.  Now, it can be
given the files with expected output directory.  This allows to
use $(*_extracted) variables (before we had to list again their
members, but limited to their base names).  In turn, this also
allows fusing the extraction recipes into a single one.

Also, it is currently too hard (or requires too much duplication,
since Make wants all the occurrences of the files to be prefixed with
$(srcdir)/, which is something Automake cannot support for *_SOURCES)
to work in the source tree.  So extract, and compile scanners and parsers
in the build tree.

	* examples/extexi (basename): New.
	(BEGIN): Now "file_wanted" maps base name to extracted file name.
	* examples/calc++/local.mk, examples/mfcalc/local.mk,
	* examples/rpcalc/local.mk: Fuse extraction rules into...
	* examples/local.mk: Here.
	(extract, extracted): New.
2012-02-24 11:04:45 +01:00

40 lines
1.3 KiB
Makefile

## Process this file with automake to produce Makefile.in -*-Makefile-*-
## Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
## -------------------- ##
## Building & testing. ##
## -------------------- ##
BUILT_SOURCES += $(mfcalc_sources)
MAINTAINERCLEANFILES += $(mfcalc_sources)
mfcalc_extracted = \
examples/mfcalc/calc.h \
examples/mfcalc/mfcalc.y
mfcalc_sources = \
$(mfcalc_extracted)
extracted += $(mfcalc_extracted)
check_PROGRAMS += examples/mfcalc/mfcalc
examples_mfcalc_mfcalc_LDADD = -lm
examples_mfcalc_mfcalc_SOURCES = \
$(mfcalc_sources)
examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_srcdir)/examples/mfcalc
TESTS += examples/mfcalc/mfcalc.test
EXTRA_DIST += examples/mfcalc/mfcalc.test