Hi,
On 9/15/26 1:37 AM, Jan Engelhardt wrote:
* making this conditional on an automake option e.g.
AM_INIT_AUTOMAKE([parallel-recursion]), because a lot of projects
likely depend on serial recursion
I would expect that most packages do, because of tests. Basically the
only packages I have that do not depend on the order of SUBDIRS are
those that I have not written any tests for.
Would it make sense to put the switch into the Makefile.am at a
directory level, so if I have something like a "plugins" directory where
each subdirectory is independent, I can run those in parallel.
The fully automated luxury solution, of course, would be something to
generate dependencies, e.g.
SUBDIRS = lib src man tests
would implicitly generate
lib_SUBDIR_DEPS =
src_SUBDIR_DEPS = lib
man_SUBDIR_DEPS = lib src
tests_SUBDIR_DEPS = lib src man
and the user could override them via
man_SUBDIR_DEPS =
with maybe an additional mechanism like
SUBDIRS = common main plugin1 plugin2
ALL_SUBDIR_DEPS = common
to generate
common_SUBDIR_DEPS =
main_SUBDIR_DEPS = common
plugin1_SUBDIR_DEPS = common
plugin2_SUBDIR_DEPS = common
but this gets complex rather quickly, e.g.
SUBDIRS = lib common main plugin1 plugin2
ALL_SUBDIR_DEPS = common
would need to resolve to
lib_SUBDIR_DEPS =
common_SUBDIR_DEPS = lib
main_SUBDIR_DEPS = common
plugin1_SUBDIR_DEPS = common
plugin2_SUBDIR_DEPS = common
(do main_SUBDIR_DEPS, plugin1_SUBDIR_DEPS, plugin2_SUBDIR_DEPS need to
include "lib" here?)
I suspect these need to be variables, not rules, to allow overriding
them easily, but it might also be possible to express them as rules that
are auto-generated unless the input file has an explicit override.
Simon