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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.