Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just have each component have its own Makefile and use a top-level Makefile to lead the orchestra.


Which 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.)


That’s not really a good idea:

Recursive Make Considered Harmful

http://aegis.sourceforge.net/auug97.pdf


Eh, 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: