TooTallNate/node-gyp — pull request #197 by iam-TJ (2013-02-16 09:39:49+00:00)
Title: Generator: make: Add support for out-of-tree builds

This change allows enables node (and other projects) to configure automatically
for out-of-tree builds. See node issue #4773.

When building to some directory that is not inside the source directory
root the extensive use of relative paths, sometimes anchored to toplevel_dir
a.k.a. the source directory root, prevents clean and automatic detection and
self-configuration.

These changes ensure that the top-level Makefile is written to the build
directory rather than the source tree, and that .mk files are created in the
correct relative paths inside the build directory (usually starting in ./out/).

If the build and source directories are the same the original behaviour
continues.

The Make variable 'srcdir' is set to an absolute path in the emitted
makefiles. Portable makefiles simply need to use $(srcdir) prefixed to relevant
paths.

Signed-off-by: TJ