mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
build: use Automake 1.14's non-recursive Makefile features
* configure.ac: Require Automake 1.14. * examples/calc++/local.mk, examples/local.mk, examples/mfcalc/local.mk, * examples/rpcalc/local.mk, tests/local.mk: Use %D% and %C%.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||
# in srcdir, including during distcheck, which is forbidden.
|
||||
examples/calc++/calc++-parser.stamp: $(BISON_IN)
|
||||
%D%/calc++-parser.stamp: $(BISON_IN)
|
||||
SUFFIXES += .yy .stamp
|
||||
.yy.stamp:
|
||||
$(AM_V_YACC)rm -f $@
|
||||
@@ -27,14 +27,14 @@ SUFFIXES += .yy .stamp
|
||||
$(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
|
||||
$(AM_V_at)mv -f $@.tmp $@
|
||||
|
||||
$(calc_sources_generated): examples/calc++/calc++-parser.stamp
|
||||
@test -f $@ || rm -f examples/calc++/calc++-parser.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
|
||||
$(calc_sources_generated): %D%/calc++-parser.stamp
|
||||
@test -f $@ || rm -f %D%/calc++-parser.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/calc++-parser.stamp
|
||||
CLEANFILES += \
|
||||
$(calc_sources_generated) \
|
||||
examples/calc++/calc++-parser.output \
|
||||
examples/calc++/calc++-parser.stamp \
|
||||
examples/calc++/calc++-scanner.cc
|
||||
%D%/calc++-parser.output \
|
||||
%D%/calc++-parser.stamp \
|
||||
%D%/calc++-scanner.cc
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
@@ -42,35 +42,35 @@ CLEANFILES += \
|
||||
## -------------------- ##
|
||||
|
||||
# Avoid using BUILT_SOURCES which is too global.
|
||||
$(examples_calc___calc___OBJECTS): $(calc_sources_generated)
|
||||
$(%C%_calc___OBJECTS): $(calc_sources_generated)
|
||||
|
||||
calc_sources_extracted = \
|
||||
examples/calc++/calc++-driver.cc \
|
||||
examples/calc++/calc++-driver.hh \
|
||||
examples/calc++/calc++-scanner.ll \
|
||||
examples/calc++/calc++.cc
|
||||
%D%/calc++-driver.cc \
|
||||
%D%/calc++-driver.hh \
|
||||
%D%/calc++-scanner.ll \
|
||||
%D%/calc++.cc
|
||||
calc_extracted = \
|
||||
$(calc_sources_extracted) \
|
||||
examples/calc++/calc++-parser.yy
|
||||
%D%/calc++-parser.yy
|
||||
extracted += $(calc_extracted)
|
||||
calc_sources_generated = \
|
||||
examples/calc++/calc++-parser.cc \
|
||||
examples/calc++/calc++-parser.hh \
|
||||
examples/calc++/location.hh \
|
||||
examples/calc++/position.hh \
|
||||
examples/calc++/stack.hh
|
||||
%D%/calc++-parser.cc \
|
||||
%D%/calc++-parser.hh \
|
||||
%D%/location.hh \
|
||||
%D%/position.hh \
|
||||
%D%/stack.hh
|
||||
calc_sources = \
|
||||
$(calc_sources_extracted) \
|
||||
$(calc_sources_generated)
|
||||
|
||||
if FLEX_CXX_WORKS
|
||||
check_PROGRAMS += examples/calc++/calc++
|
||||
nodist_examples_calc___calc___SOURCES = \
|
||||
check_PROGRAMS += %D%/calc++
|
||||
nodist_%C%_calc___SOURCES = \
|
||||
$(calc_sources)
|
||||
|
||||
examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
|
||||
examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||
dist_TESTS += examples/calc++/calc++.test
|
||||
%C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
|
||||
%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||
dist_TESTS += %D%/calc++.test
|
||||
else
|
||||
EXTRA_DIST += examples/calc++/calc++.test
|
||||
EXTRA_DIST += %D%/calc++.test
|
||||
endif
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
dist_noinst_SCRIPTS = examples/extexi examples/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/examples/test
|
||||
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/%D%/test
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||
@@ -24,20 +24,20 @@ AM_CXXFLAGS = \
|
||||
## ------------ ##
|
||||
|
||||
doc = $(top_srcdir)/doc/bison.texi
|
||||
extexi = $(top_srcdir)/examples/extexi
|
||||
extexi = $(top_srcdir)/%D%/extexi
|
||||
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(doc) --
|
||||
extracted =
|
||||
CLEANFILES += $(extracted) examples/extracted.stamp
|
||||
examples/extracted.stamp: $(doc) $(extexi)
|
||||
CLEANFILES += $(extracted) %D%/extracted.stamp
|
||||
%D%/extracted.stamp: $(doc) $(extexi)
|
||||
$(AM_V_GEN)rm -f $@ $@.tmp
|
||||
$(AM_V_at)touch $@.tmp
|
||||
$(AM_V_at)$(extract) $(extracted)
|
||||
$(AM_V_at)mv $@.tmp $@
|
||||
|
||||
$(extracted): examples/extracted.stamp
|
||||
@test -f $@ || rm -f examples/extracted.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
|
||||
$(extracted): %D%/extracted.stamp
|
||||
@test -f $@ || rm -f %D%/extracted.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
|
||||
|
||||
include examples/calc++/local.mk
|
||||
include examples/mfcalc/local.mk
|
||||
include examples/rpcalc/local.mk
|
||||
include %D%/calc++/local.mk
|
||||
include %D%/mfcalc/local.mk
|
||||
include %D%/rpcalc/local.mk
|
||||
|
||||
@@ -18,19 +18,15 @@
|
||||
## -------------------- ##
|
||||
|
||||
BUILT_SOURCES += $(mfcalc_sources)
|
||||
CLEANFILES += examples/mfcalc/mfcalc.[ch] examples/mfcalc/mfcalc.output
|
||||
CLEANFILES += %D%/mfcalc.[ch] %D%/mfcalc.output
|
||||
|
||||
mfcalc_extracted = \
|
||||
examples/mfcalc/calc.h \
|
||||
examples/mfcalc/mfcalc.y
|
||||
mfcalc_sources = \
|
||||
$(mfcalc_extracted)
|
||||
mfcalc_extracted = %D%/calc.h %D%/mfcalc.y
|
||||
mfcalc_sources = $(mfcalc_extracted)
|
||||
extracted += $(mfcalc_extracted)
|
||||
|
||||
check_PROGRAMS += examples/mfcalc/mfcalc
|
||||
examples_mfcalc_mfcalc_LDADD = -lm
|
||||
nodist_examples_mfcalc_mfcalc_SOURCES = \
|
||||
$(mfcalc_sources)
|
||||
check_PROGRAMS += %D%/mfcalc
|
||||
%C%_mfcalc_LDADD = -lm
|
||||
nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
||||
|
||||
examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
|
||||
dist_TESTS += examples/mfcalc/mfcalc.test
|
||||
%C%_mfcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
dist_TESTS += %D%/mfcalc.test
|
||||
|
||||
@@ -18,18 +18,15 @@
|
||||
## -------------------- ##
|
||||
|
||||
BUILT_SOURCES += $(rpcalc_sources)
|
||||
CLEANFILES += examples/rpcalc/rpcalc.[ch] examples/rpcalc/rpcalc.output
|
||||
CLEANFILES += %D%/rpcalc.[ch] %D%/rpcalc.output
|
||||
|
||||
rpcalc_extracted = \
|
||||
examples/rpcalc/rpcalc.y
|
||||
rpcalc_sources = \
|
||||
$(rpcalc_extracted)
|
||||
rpcalc_extracted = %D%/rpcalc.y
|
||||
rpcalc_sources = $(rpcalc_extracted)
|
||||
extracted += $(rpcalc_extracted)
|
||||
|
||||
check_PROGRAMS += examples/rpcalc/rpcalc
|
||||
examples_rpcalc_rpcalc_LDADD = -lm
|
||||
nodist_examples_rpcalc_rpcalc_SOURCES = \
|
||||
$(rpcalc_sources)
|
||||
check_PROGRAMS += %D%/rpcalc
|
||||
%C%_rpcalc_LDADD = -lm
|
||||
nodist_%C%_rpcalc_SOURCES = $(rpcalc_sources)
|
||||
|
||||
examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
|
||||
dist_TESTS += examples/rpcalc/rpcalc.test
|
||||
%C%_rpcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
dist_TESTS += %D%/rpcalc.test
|
||||
|
||||
Reference in New Issue
Block a user