Hacker News new | ask | show | jobs
by CameronNemo 1954 days ago
Can't good old make do partial recompilation with ease?
1 comments

Correct me if I'm wrong, but don't you have to formally map out all of your inputs and outputs for partial recompilation to work?

I believe the last time I touched make was to fix an exceedingly badly mapped out chain of cause and effect that would consistently compile too much and yet occasionally miss the one thing you actually needed.

Partial evaluation works out the dependencies by evaluating all of the conditional logic and seeing which inputs interact with which outputs.

> Correct me if I'm wrong, but don't you have to formally map out all of your inputs and outputs for partial recompilation to work?

Make needs that information, but that doesn't mean you need to be the one to catalog it. I found this article pretty useful [1]; in a nutshell, many compilation tools (including gcc, clang, and erlc) are happy to write a file that lists the compile time resources they used, and you can use that file to tell Make what the dependencies are. It's a bit meta, so it made my brain hurt a bit, but it can work pretty well, and you can use it with templated rules to really slim down your Makefile.

(I've tested this with GNU Make; don't know if it's workable with BSD Make)

[1] http://make.mad-scientist.net/papers/advanced-auto-dependenc...