Restore tolerance of self-referencing phony build statements

Since commit v1.8.0^2~3^2~1 (Teach RecomputeDirty to detect cycles in
the build graph, 2015-11-13) we correctly reject self-referencing phony
build statements like

    build a: phony a

as cycles.  Unfortunately this breaks support for CMake 2.8.12.x and
3.0.x because those versions incorrectly produce edges of this form
(that we used to tolerate).  In order to preserve compatibility with
those CMake versions we need to restore tolerance of these edges.

Add a special case to the manifest parser to filter out self-referencing
inputs of phony edges of the form produced by those CMake versions.
Warn by default, but add a `-w phonycycle={err,warn}` option to make it
an error.

Fixes: #1322
8 files changed