]> git.saurik.com Git - bison.git/commitdiff
build: fix more example extraction issues.
authorAkim Demaille <demaille@gostai.com>
Fri, 24 Feb 2012 11:10:07 +0000 (12:10 +0100)
committerAkim Demaille <demaille@gostai.com>
Fri, 24 Feb 2012 12:32:17 +0000 (13:32 +0100)
* Makefile.am (dist_TESTS): New.
(TESTS, EXTRA_DIST): Run and ship them.
* examples/calc++/local.mk: examples/calc++/calc++.stamp no longer
        exists, don't try to ship it.
(.yy.stamp): New recipe.
Use it.
* examples/calc++/local.mk, examples/mfcalc/local.mk,
* examples/rpcalc/local.mk:
Don't ship the sources.
Adjust the CPPFLAGS: there is nothing left in srcdir.
(MAINTAINERCLEANFILES): Remove, now we are in builddir.
(TESTS): Rename as...
(dist_TESTS): this.

Makefile.am
examples/calc++/local.mk
examples/mfcalc/local.mk
examples/rpcalc/local.mk

index 26e87cfd3372a003a35e30c62613dc8347fe0fa8..30de106218922d7cb1e5f576566a5d7f6ae4f930 100644 (file)
@@ -41,11 +41,13 @@ AM_CFLAGS = $(WARN_CFLAGS)
 AM_CPPFLAGS = -I. -Ilib -I$(top_srcdir) -I$(top_srcdir)/lib
 BUILT_SOURCES =
 DISTCLEANFILES =
+EXTRA_DIST += $(dist_TESTS)
 MOSTLYCLEANDIRS =
 MOSTLYCLEANFILES =
 SUFFIXES =
-TESTS =
+TESTS = $(dist_TESTS)
 check_PROGRAMS =
+dist_TESTS =
 noinst_LIBRARIES =
 
 include build-aux/local.mk
index 8a0397360f702ff4db3228190724255e80be075d..884bcc58290a96582696639c9364a0c84234b079 100644 (file)
 ## Parser generation.  ##
 ## ------------------- ##
 
-CLEANFILES += $(top_srcdir)/examples/calc++/*.output *.tmp
-MAINTAINERCLEANFILES += examples/calc++/*.stamp $(calc_sources)
+CLEANFILES += examples/calc++/calc++-parser.output *.tmp
 
-# Compile the parser and save cycles.
-# This code comes from "Handling Tools that Produce Many Outputs",
-# from the Automake documentation.
-EXTRA_DIST +=                                  \
-  examples/calc++/calc++-parser.stamp          \
-  examples/calc++/calc++-parser.yy             \
-  examples/calc++/calc++.stamp
 # Don't depend on $(BISON) otherwise we would rebuild these files
 # in srcdir, including during distcheck, which is forbidden.
-examples/calc++/calc++-parser.stamp: examples/calc++/calc++-parser.yy $(BISON_IN)
+examples/calc++/calc++-parser.stamp: $(BISON_IN)
+SUFFIXES += .yy .stamp
+.yy.stamp:
        $(AM_V_YACC)rm -f $@
        $(AM_V_at)touch $@.tmp
-       $(AM_V_at)$(YACCCOMPILE) -o examples/calc++/calc++-parser.cc    \
-         examples/calc++/calc++-parser.yy
+       $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
        $(AM_V_at)mv -f $@.tmp $@
 
 $(calc_sources_generated): examples/calc++/calc++-parser.stamp
@@ -49,8 +42,6 @@ $(calc_sources_generated): examples/calc++/calc++-parser.stamp
 
 # Avoid using BUILT_SOURCES which is too global.
 $(examples_calc___calc___OBJECTS): $(calc_sources_generated)
-CLEANFILES += *.tmp
-MAINTAINERCLEANFILES += $(calc_sources)
 
 calc_sources_extracted =                       \
   examples/calc++/calc++-driver.cc             \
@@ -70,16 +61,12 @@ calc_sources_generated =                    \
 calc_sources =                                 \
   $(calc_sources_extracted)                    \
   $(calc_sources_generated)
+
 if BISON_CXX_WORKS
 check_PROGRAMS += examples/calc++/calc++
-examples_calc___calc___SOURCES =               \
+nodist_examples_calc___calc___SOURCES =                \
   $(calc_sources)
 
-examples_calc___calc___CPPFLAGS =              \
-  -I$(top_builddir)/examples/calc++            \
-  -I$(top_srcdir)/examples/calc++
-TESTS += examples/calc++/calc++.test
+examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
+dist_TESTS += examples/calc++/calc++.test
 endif
-EXTRA_DIST +=                                  \
-  examples/calc++/calc++-parser.yy             \
-  examples/calc++/calc++.test
index 8083dea06ff20e3ac5e8c3869dec2f03a59391a5..539b4d0b2a5b707471f95d0a2d5e6fe4ddba7e94 100644 (file)
@@ -20,7 +20,6 @@
 ## -------------------- ##
 
 BUILT_SOURCES += $(mfcalc_sources)
-MAINTAINERCLEANFILES += $(mfcalc_sources)
 
 mfcalc_extracted =                             \
   examples/mfcalc/calc.h                       \
@@ -31,9 +30,8 @@ extracted += $(mfcalc_extracted)
 
 check_PROGRAMS += examples/mfcalc/mfcalc
 examples_mfcalc_mfcalc_LDADD = -lm
-examples_mfcalc_mfcalc_SOURCES =               \
+nodist_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
+examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
+dist_TESTS += examples/mfcalc/mfcalc.test
index 844ffdfff90b9e818d669f7b986309b36aea2cd5..4351dc5a03ab7edafed5e73dd58ae4ce449501d7 100644 (file)
@@ -20,7 +20,6 @@
 ## -------------------- ##
 
 BUILT_SOURCES += $(rpcalc_sources)
-MAINTAINERCLEANFILES += $(rpcalc_sources)
 
 rpcalc_extracted =                             \
   examples/rpcalc/rpcalc.y
@@ -30,9 +29,8 @@ extracted += $(rpcalc_extracted)
 
 check_PROGRAMS += examples/rpcalc/rpcalc
 examples_rpcalc_rpcalc_LDADD = -lm
-examples_rpcalc_rpcalc_SOURCES =               \
+nodist_examples_rpcalc_rpcalc_SOURCES =                \
   $(rpcalc_sources)
 
-examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_srcdir)/examples/rpcalc
-TESTS += examples/rpcalc/rpcalc.test
-EXTRA_DIST += examples/rpcalc/rpcalc.test
+examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
+dist_TESTS += examples/rpcalc/rpcalc.test