Adding VPATH Build Functionality

At the end of Chapter 2, I mentioned that I hadn't yet covered an important concept—that of VPATH builds. A VPATH build is a way of using a makefile construct (VPATH) to configure and build a project in a directory other than the source directory. This is important if you need to perform any of the following tasks:

  • Maintain a separate debug configuration

  • Test different configurations side by side

  • Keep a clean source directory for patch diffs after local modifications

  • Build from a read-only source directory

The VPATH keyword is short for virtual search path. A VPATH statement contains a colon-separated list of places to look for relative-path dependencies when they can't be found relative to the current directory. In ...

Get Autotools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.