This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
non-recursive make and tests
- From: Bob Friesenhahn <bfriesen at simple dot dallas dot tx dot us>
- To: automake at gnu dot org
- Date: Mon, 30 Aug 2004 10:01:26 -0500 (CDT)
- Subject: non-recursive make and tests
I have spent the weekend working on converting a large package
(GraphicsMagick) to use a single Makefile (actually a top Makefile.am
with subordinate includes). Progress has gone very well. All targets
are properly built and installed. It takes only half a second for
make to decide there is nothing to do.
Unfortunately, the most difficult part of converting to a single
Makefile remains. That difficult part is the test suite. When using
a single Makefile, the default directory is the top of the build
directory. Test scripts and programs usually prefer to be executed in
the directory where the test script or program resides since it is
useful for any output (including core files) to be written in the same
directory as the test. When execting tests, $srcdir is set to the top
of the source tree ($top_srcdir) rather than a relative position. To
make matters worse, $srcdir is often set to something relatively
useless like '.' or '..' so it is difficult to make sense of it.
Since the starting point for tests is always the top of the build
directory, test scripts and programs become infected with commands to
cd to the test directory. They also become infected with code to
evaluate the actual relative srcdir so they can find their input
files. This makes developing a test suite which passes the distcheck
tests much more difficult.
It would be quite helpful if Automake offered a mode in which it
automatically changed the working directory to the directory where the
test program/script resides and set $srcdir to the relative position
in the source tree to support VPATH builds. This would emulate the
operation of recursive builds. Either a global Automake option could
be used to enable this (subdir-tests), or a "RTESTS" (relative tests)
mode would be provided.
What would it take to make this happen?
Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen