Commit Graph

16 Commits

Author SHA1 Message Date
Akim Demaille
afc4457605 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%.
2013-11-05 14:32:20 +01:00
Paul Eggert
3a684d611e build: examples/calc++/calc++ requires flex
* configure.ac (FLEX_CXX_WORKS): New AM_CONDITIONAL.
* examples/calc++/local.mk (examples/calc++/calc++):
Build if FLEX_CXX_WORKS, not BISON_CXX_WORKS.
2013-10-21 15:23:42 -07:00
Akim Demaille
0fcc2e9a74 build: ship all the files, even if the C++ compiler is broken
* examples/calc++/local.mk: Be sure to ship calc++.test even if
the current C++ compiler is not sufficient to run the tests.
2013-06-11 16:36:38 +02:00
Akim Demaille
5ae8eb3202 tests: fix failures with G++ 4.8 in Flex scanner
* configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Rename as...
(FLEX_SCANNER_CXXFLAGS): this.
Pass -Wno-zero-as-null-pointer-constant to G++ if it supports it.
* examples/calc++/local.mk: Adjust.
2013-02-19 17:42:33 +01:00
Akim Demaille
1217688141 build: please Clang++ 3.2+ on Flex scanners
Clang++, with -Wall, rejects code generated by Flex (for C scanners):

  CXX      examples/calc++/examples_calc___calc__-calc++-scanner.o
  In file included from examples/calc++/calc++-scanner.cc:1:
  error: implicit conversion of NULL constant to 'bool' [-Werror,-Wnull-conversion]
  if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : __null) ) {
       ~                                                                  ^~~~~~
                                                                          false
* configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Compute it.
* examples/calc++/local.mk (examples_calc___calc___CXXFLAGS): Use it.
2013-01-30 16:10:00 +01:00
Akim Demaille
7d6bad1959 maint: update copyright years
Suggested by Stefano Lattarini.
Run "make update-copyright".
2013-01-12 16:14:16 +01:00
Akim Demaille
9fd33c2b6e maint: address syntax-check issues.
* examples/calc++/local.mk: Space changes.
* src/files.c: Avoid unmarked_diagnostics.
* src/output.c: Remove useless include.
2012-06-21 16:02:10 +02:00
Akim Demaille
fca5693b76 maint: fix distcheck.
* examples/local.mk (MAINTAINERCLEANFILES): Complete, and rename as...
(CLEANFILES): this,
* examples/calc++/local.mk, examples/mfcalc/local.mk,
* examples/rpcalc/local.mk (CLEANFILES): Add the generated files.
2012-03-13 11:58:46 +01:00
Akim Demaille
2a55930762 build: comment changes.
* Makefile.am, examples/calc++/local.mk, examples/local.mk,
	* examples/mfcalc/local.mk, examples/rpcalc/local.mk,
	* lib/local.mk, src/local.mk, tests/local.mk:
	Make the copyright licenses more uniform.
2012-02-24 14:01:13 +01:00
Akim Demaille
59fba180a5 build: fix more example extraction issues.
* 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.
2012-02-24 13:32:17 +01:00
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
Akim Demaille
5a9c6b89d0 examples: factor the test suite.
* examples/mfcalc/test, examples/calc++/test: Extract the
	common bits into...
	* examples/test: here.
	(cwd): New.
	Use it to avoid a race on the temporary directory.
	Reported by Jim Meyering.
	* examples/mfcalc/test, examples/calc++/test: Rename into...
	* examples/mfcalc/mfcalc.test, examples/calc++/calc++.test: these.
	* examples/calc++/local.mk, examples/mfcalc/local.mk,
	* examples/local.mk: Adjust.
2012-02-17 15:49:00 +01:00
Akim Demaille
2e4986a88d calc++: factor for other extracted tests.
* Makefile.am (TESTS, check_PROGRAMS): Initialize here.
	* examples/local.mk (doc, extexi): Define here.
	* examples/calc++/local.mk: Adjust accordingly.
	* configure.ac: Ask for parallel-tests (for the way the logs
	are handled).
	* examples/calc++/test: As a consequence, always be verbose.
	($prog): New.
	(run): Use it.
	Sort the tests in a more natural order (simplest first).
2012-02-16 15:52:14 +01:00
Akim Demaille
3d6ca33908 maint: trust Automake for parser headers.
* examples/calc++/local.mk, src/local.mk: Now that automake
	can see `-d' in AM_YFLAGS, we can rely on it to compile
	and ship the parser header files.
2012-02-15 13:33:42 +01:00
Akim Demaille
609b3d8096 calc++: rely on Automake.
Rely on $(YACC) being the bison being built, and let Automake do the
rest.  It turned out to be much more difficult than anticipated, for
various reasons, including some bad behavior from Automake 1.11.2
which (i) generates calc++-parser.h instead of calc++-parser.hh, and
(ii) leaves an #include "y.tab.h" in the generated parser instead
of #include "calc++-parser.h".

The authors of Automake appear to be aware of the problem,
http://lists.gnu.org/archive/html/automake/2011-05/msg00008.html
so a simple work around will suffice for the time being.

	* examples/calc++/y.tab.h, examples/calc++/calc++-parser.hh: New.
	To work around Automake 1.11.2 issues.
	* examples/calc++/local.mk: Remove all the rules for compilation
	with bison, leave them to Automake.
	So provide it with "calc++-parse.yy" as a source file.
	(calc_sources_generated, calc_sources_extracted): Rename as.
	(calc_generated, calc_extracted): these.
	(calc_sources): New.
	Fix them.
2012-02-15 11:31:49 +01:00
Akim Demaille
360ae94ebc maint: de-recurse the handling of examples
The directory was still using a local Makefile.am because it provides
"scoped" Make variables: these examples are not meant to use the same
CPPFLAGS etc.  If we were to use the same -I set, we'd pick up
gnulib's stdio.h for instance, which we do not want for these simple
examples.

Yet, as a result, the dependencies are less accurate, there is code
duplication, etc.  This is especially perceptible when trying to
extract more examples from the documentation, as will be done in
forthcoming changes.

In order to make the tuning of CPPFLAGS easier, discard the predefined
-I from Automake.

	* examples/calc++/Makefile.am: Rename as...
	* examples/calc++/local.mk: this.
	Adjust the paths which are now rooted in top_srcdir/top_builddir.
	Handle BISON_CXX_WORKS here, instead of the too crude previous
	approach that completely discarded the whole directory.
	($(BISON)): Remove now useless bouncing recipe.
	(calc___CPPFLAGS): New.
	Stay away from -Ilib.
	* Makefile.am, configure.ac, examples/local.mk,
	* examples/calc++/test: Adjust.

	* configure.ac: Pass nostdinc to Automake.
	* src/local.mk, lib/local.mk (AM_CPPFLAGS): Move to...
	* Makefile.am: here.

	* src/local.mk, examples/calc++/Makefile.am (BISON, BISON_IN): Factor
	to...
	* Makefile.am: here.
	* tests/local.mk: Use it.
2012-02-14 21:00:59 +01:00