AutoGen: Fix over-specified direct dependencies of custom command

The AutoMoc timestamp creating custom command explicitly depended
on all dependencies of the origin target (associated to the AutoGen
target).

When an origin target depended on a shared library 'libfoo.so',
if it was re-linked, the AutoMoc custom command would touch its
output timestamp file, and thus cause needless rebuilding of sources,
despite the shared library not having any influence on the AutoMoc
generated files.

Introduce a new '<target>_autogen_timestamp_deps' utility target,
which will serve as an 'order-only' dependency for the custom command.

This will prevent needless rebuilding, because touching 'libfoo.so'
will not cause the custom command to be re-executed.

The new AutoMoc dependency tree looks like:
    '_autogen_timestamp_deps (serves as order-only dep)'
 <- '<target_autogen>/timestamp' file ( + moc deps file)
 <- '<target>_autogen' target.

Fixes: #21020
2 files changed