* Brian Barrett wrote on Thu, Jul 24, 2008 at 02:28:45PM CEST: > When I looked at the same problem in LAM, I couldn't get the > dependencies right between libraries when only one makefile was used. It > worked up until I would do a parallel build, then would die because the > libraries weren't ready at the right time. There's probably a way, but I > ended up with Jeff's approach.
I have no idea what Jeff's approach is, and I would not recommend entering some makefiles more than once, but what you can do is list some files outside their directory. I.e, you could have -- mpi/f77/Makefile_base.am -- libmpi_f77_base_la_SOURCES = mpi/f77/file1.f ... -- Makefile.am -- include mpi/f77/Makefile_base.am ... -- mpi/f77/Makefile.am -- # This will appear later in SUBDIRS libmpi_f77_la_SOURCES = file3.f ... ... to avoid actually moving around files. If you find a bug with parallel make that way, then please report it to the Automake list (but we haven't seen any Automake bugs in this area for quite a while). I haven't checked how the profiling stuff fits in this picture. Just remember that the ordered graph connecting Makefiles (as opposed to included makefile snippets, or source files) through SUBDIRS entries should be a tree, and this tree is always traversed bottom up unless '.' is listed somewhere explicitly. Cheers, Ralf