-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
out of tree builds? #2
Comments
Out-of-sourcetree builds would be a great thing to have but there's one reason I don't see how to implement that. It depends on VPATH, and VPATH needs automatic variables in recipes. Variable $^ expands to the prerequisites of a target. When prerequisites are object files only, this works. But Makefile.pdlibbuilder defines implicit dependencies (header files) as prerequisites too when doing non-clean builds. In that case I can't find a way to reference the object files in the recipe. If you have a suggestion how to solve this catch I'm all ears. |
OK makes sense (and I don't have any suggestions). Maybe it should be mentioned somewhere in the docs. |
This documentation by Paul D. Smith, maintainer of GNU make brought the topic to my mind again: http://make.mad-scientist.net/papers/how-not-to-use-vpath/ The second article illustrates several methods to build outside source directories. His favorite method implements a bunch of nifty make tricks. Not sure if these are compatible with Makefile.pdlibbuilder's own nifty tricks. I'm now thinking that my earlier argument about $^ may not be relevant. For executables which are built directly from multiple source files (with implicit linking) the automatic variables can't be used. But such targets aren't defined in Makefile.pdlibbuilder. Maybe the automatic variables can be used throughout, and VPATH / vpath supported. That is only a first step (convenient but not even strictly required) towards out of source tree builds. I'll keep this topic on my (admittedly not well-defined) agenda. |
is it possible to build out-of-sourcetree builds (that is: running the build from a directory different from where the
Makefile
is)?this can be very handy when building for multiple configurations (architectures, optimization,...)
The text was updated successfully, but these errors were encountered: