]> git.saurik.com Git - bison.git/commitdiff
build: use Automake 1.14's non-recursive Makefile features
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 5 Nov 2013 13:32:20 +0000 (14:32 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 5 Nov 2013 13:32:20 +0000 (14:32 +0100)
* 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%.

configure.ac
examples/calc++/local.mk
examples/local.mk
examples/mfcalc/local.mk
examples/rpcalc/local.mk
tests/local.mk

index 688803af2363b4d9a8545a6f3c52b21a549e29b9..f3dcdfd86ae2c9c56a62cc3506676b19709ea202 100644 (file)
@@ -33,11 +33,7 @@ AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 
-# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
-#
-#   http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
-#
-# To avoid 1.11, we make 1.11.1 the minimum version.
+# We use Automake 1.14's %D% and %C%.
 #
 # We want gnits strictness only when rolling a stable release.  For
 # release candidates, we use version strings like 2.4.3_rc1, but gnits
@@ -45,7 +41,7 @@ AC_CONFIG_MACRO_DIR([m4])
 # releases, we want to be able run make dist without being required to
 # add a bogus NEWS entry.  In that case, the version string
 # automatically contains a dash, which we also let disable gnits.
-AM_INIT_AUTOMAKE([1.11.1 dist-xz nostdinc
+AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc
                  color-tests parallel-tests
                  silent-rules]
                  m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
index 493b8c78da729b278b088dd269b74faed82bf475..d920e634b7d17828a86d4936cde34a5d68d13203 100644 (file)
@@ -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
index c79c80044ffbad4a6e164066ce30f4d46ef96d5c..9f7863c14922a4bcab65520f8e7ede68c310189d 100644 (file)
@@ -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
index 10d669665e894e9222b0f1e95787f22fafd787db..97ea63b35b1cfee6bbec17efff21de92ab1af95c 100644 (file)
 ## -------------------- ##
 
 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
index 3ff2f98c590b21c808aa599d2b8b51f204952440..97f35356d3f1f97da1319515e419f809684da643 100644 (file)
 ## -------------------- ##
 
 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
index fbf08ba2cb3bf40fde80d9d7bb6bfae55b5d1633..394a92e585aa627e16e5a872e8a576d9987a7eee 100644 (file)
@@ -85,7 +85,7 @@ $(TESTSUITE): $(TESTSUITE_AT)
 # Move into tests/ so that testsuite.dir etc. be created there.
 RUN_TESTSUITE = $(TESTSUITE) -C tests $(TESTSUITEFLAGS)
 check_SCRIPTS = $(BISON) tests/atconfig tests/atlocal
-RUN_TESTSUITE_deps = $(TESTSUITE) $(check_SCRIPTS)
+RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS)
 
 clean-local: clean-local-tests
 clean-local-tests: