&gt; (3) invoke the makefile multiple times with different settings<p>This is what I mean, more or less. Your build directory contains a generated configuration state (generated by GNU autoconf, for example), and a wrapper Makefile that reads the configuration and builds everything (maybe by invoking a &quot;real&quot; Makefile in the source directory if you&#x27;re lucky, maybe by having a bunch of ugly Makefiles generated in the build directory too, as GNU automake does).<p>And (provided you avoid automake) I don&#x27;t find it horrible at all.