3 ms·
Makefiles tend to get really messy when you have to build libraries and components in separate directories. It's definitely tuned more towards building single t
by mozumder 9y ago
Makefiles tend to get really messy when you have to build libraries and components in separate directories. It's definitely tuned more towards building single target projects.
- pif 9y agoJust have each component have its own Makefile and use a top-level Makefile to lead the orchestra.
- AstralStorm 9y agoWhich is fragile. Extremely fragile in fact. I've seen failures of such schemes to rebuild stuff when command line parameters (defines, environment) changed. It also brings all sorts of trouble in parallel builds as Make is weak at handling dependencies that are not generated in the exact Makefile you run. (Thus non-recursive Makefile which still fail and have other warts.) Even cmake and autoconf generated Makefile have trouble with complex projects. (Part of the reason why cmake can now generate Ninja files instead.)
- teddyh 9y agoThat’s not really a good idea: Recursive Make Considered Harmful http://aegis.sourceforge.net/auug97.pdf http://aegis.sourceforge.net/auug97.pdf
- Nursie 9y agoEh, but by using includes you can still modularise. I have a recursive-make project at the moment that suffers from none of the problems described in the paper. We will likely move to an include-based scheme before long, which will take some minor tweaking of targets in the leaf Makefiles. Also - Considered harmful essays considered harmful - http://meyerweb.com/eric/comment/chech.html http://meyerweb.com/eric/comment/chech.html