Like anything else, recursive make can be used in a right way and in a wrong way.
It can be used in a wrong way, like described in the article linked by you, when it results in slow project building.
How I use recursive make, it does not introduce any slowdown whatsoever.
I organize my projects so that there is a one-to-one correspondence between leaf Makefiles and the final files that are generated as a result of the building process, regardless of the file types, e.g. executable files, static libraries, dynamic libraries, executable files including GUI resources, documentation files etc.
A generated file may depend on source files located in many directories. Those files are searched and used by the single "make" command that generates one result file (by using the GNU make directory search functions, e.g. "wildcard", "notdir", "addsuffix", "addprefix"), not by recursive make invocations.
I also never write dependencies manually, I always generate them automatically. I also never write the names of source files in makefiles, I only provide a top directory and/or a list of subdirectories, where source files can be found automatically. This means that I never need to edit a makefile when source files are added, moved, renamed or deleted.
I use recursive "make" invocations only for generating multiple result files with a single make command in the top of a directory tree that contains subdirectories where each result file will be built (which also store the corresponding intermediate files, e.g. object files).
The directory tree used for project building is located elsewhere than the source files and its tree structure is not related to the tree structure of the source files, but it is determined only by the number of final files that are produced when building the project, which will be included in a release.
fragmede · · focus · HN ↗
<a href="https://accu.org/journals/overload/14/71/miller_2004/" rel="nofollow">https://accu.org/journals/overload/14/71/miller_2004/
Recursive Make Considered Harmful
By Peter Miller
adrian_b · · focus · HN ↗
It can be used in a wrong way, like described in the article linked by you, when it results in slow project building.
How I use recursive make, it does not introduce any slowdown whatsoever.
I organize my projects so that there is a one-to-one correspondence between leaf Makefiles and the final files that are generated as a result of the building process, regardless of the file types, e.g. executable files, static libraries, dynamic libraries, executable files including GUI resources, documentation files etc.
A generated file may depend on source files located in many directories. Those files are searched and used by the single "make" command that generates one result file (by using the GNU make directory search functions, e.g. "wildcard", "notdir", "addsuffix", "addprefix"), not by recursive make invocations.
I also never write dependencies manually, I always generate them automatically. I also never write the names of source files in makefiles, I only provide a top directory and/or a list of subdirectories, where source files can be found automatically. This means that I never need to edit a makefile when source files are added, moved, renamed or deleted.
I use recursive "make" invocations only for generating multiple result files with a single make command in the top of a directory tree that contains subdirectories where each result file will be built (which also store the corresponding intermediate files, e.g. object files).
The directory tree used for project building is located elsewhere than the source files and its tree structure is not related to the tree structure of the source files, but it is determined only by the number of final files that are produced when building the project, which will be included in a release.