Simplify and optimize FindCycles

Finding cycles in a directed graph only requires a simple depth first
traversal, it does not require checking every path in the graph.

This is now fast enough to actually identify and print cycles between
targets.

Changes the error message slightly for file and target cycles,
and adds tests for both those cases.

Patch from cjhopman@chromium.org.

R=scottmg@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1992 78cadc50-ecff-11dd-a971-7dbc132099af
Stop checking for duplicate basenames

Chromium doesn't care about MSVC08 or Mac OS X makefiles anymore,
whereas some third_party libraries we'd like to use within Chromium
contain source files with duplicate basenames.

Discussion link: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/0rDiXgLvywY/sm0LSj-hiDIJ

Patch from mdempsky@chromium.org

R=scottmg@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1993 78cadc50-ecff-11dd-a971-7dbc132099af
Moves warning about invalid targets into 'invalid_targets' in result

Previously if an invalid_target was supplied analyze would report it
via 'warning'. I'm moving that warning to 'invalid_targets' and
providing the list of invalid targets there.

BUG=426892
TEST=covered by tests
R=scottmg@chromium.org

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

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