#86: Simplify the creation and maintenance of Makefile.am's under milena/tests/
--------------------------+-------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: enhancement | Status: new
Priority: minor | Milestone: Olena 1.1
Component: Milena | Version: 1.0
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Changes (by levill_r):
* milestone: Olena 1.0 => Olena 1.1
Old description:
Currently, a `Makefile.am` in a subdirectory of
`milena/tests/`, e.g.
`milena/tests/foo/Makefile.am` looks like this:
{{{
## Process this file through Automake to create Makefile.in -*- Makefile
-*-
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
bar \
baz
bar_SOURCES = bar.cc
baz_SOURCES = baz.cc
TESTS = $(check_PROGRAMS)
}}}
But as the `check_PROGRAMS` variable grows, so does the number of
`*_SOURCES` variables.
Automake provides a solution to handle this more or less nicely when
tests are written in the C language: when a program `quux` listed in
`check_PROGRAMS` has no corresponding `quux_SOURCES`, Automake acts as if
the following line were written in the `Makefile.am`:
quux_SOURCES = quux.c
It would be nice from Automake to provide an option to change the
extension of this pattern from `.c` to `.cc`. Unfortunalety, we cannot.
:-(
A solution would be to ''generate'' the list of sources with a shell
script, as we do it in the `Makefile.am`'s of the tests of the Tiger
Compiler project. I we do so, careful with the dependencies!
New description:
Currently, a `Makefile.am` in a subdirectory of `milena/tests/`, e.g.
`milena/tests/foo/Makefile.am` looks like this:
{{{
## Process this file through Automake to create Makefile.in -*- Makefile
-*-
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
bar \
baz
bar_SOURCES = bar.cc
baz_SOURCES = baz.cc
TESTS = $(check_PROGRAMS)
}}}
But as the `check_PROGRAMS` variable grows, so does the number of
`*_SOURCES` variables.
Automake provides a solution to handle this more or less nicely when tests
are written in the C language: when a program `quux` listed in
`check_PROGRAMS` has no corresponding `quux_SOURCES`, Automake acts as if
the following line were written in the `Makefile.am`:
quux_SOURCES = quux.c
It would be nice from Automake to provide an option to change the
extension of this pattern from `.c` to `.cc`. Unfortunalety, we cannot.
:-(
A solution would be to ''generate'' the list of sources with a shell
script, as we do it in the `Makefile.am`'s of the tests of the Tiger
Compiler project. If we do so, be careful with the dependencies!
--
Comment:
Not a real requirement for [milestone:"Olena 1.0" Olena 1.0]; postponing.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/86#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.