I want to break up a Makefile into two for Modularity / Separation all that goodness. What are some pointers to look out for when choosing between include and submake?
One I can think of immediately is that for submake, you still have to remap the targets in the child to targets in the parent in the parent Makefile.
A detailed discussion of this is Recursive Make Considered Harmful
As you might guess from the title, RCMH argues that including everything into a single makefile (“non-recursive”) is preferable to running submakes (“recursive”).
The main arguments in favour of non-recursive
makeare performance and accuracy of cross-module dependencies (which also has performance implications for parallel builds).The advantage of recursive makefile systems is that they are simpler to write, because each module’s
makeinvocation is separate from all the others. As RCMH points out, though, this total separation actually causes problems later.