Add an option to prune targets

Normally, when a target in file1.gyp depends on a target in file2.gyp,
gyp will generate projects for all targets in file2.gyp, even if the
target in file1.gyp does not depend on all of them.

This patch adds a '--root-target' command-line option, which allows users
to specify a list of "root" targets in the dependency tree.  When this
list is provided, gyp will only generate projects for targets that
are deep dependencies of these root targets.

As an example, when used in the chromium repository, running 'gyp_chromium'
with 'content.gyp' generates 397 subninja files.  With '--root-target=content'
specified, this is reduced to just 260 subninja files.

BUG=
R=mark@chromium.org

Review URL: https://codereview.chromium.org/24803004

git-svn-id: http://gyp.googlecode.com/svn/trunk@1745 78cadc50-ecff-11dd-a971-7dbc132099af
11 files changed