It seems possible that some old make implementations could have low
limits on the number and line length of Makefile rules, which would
explain the need for the awk code in mkdep in 1988.
That said, many still-used copies and derivatives of mkdep do not have
the awk code, which hints that either the problem no longer exists or
the workarounds have since settled elsewhere: most compilers that
Autoconf cares to use for dependency generation (GCC, Clang and XL C
16.1) produce dependency rules with long lines already nicely wrapped,
and even though SunStudio 11 produces plenty of short lines, the result
does not affect make on Solaris 9.
Since the only practical effect of the awk code seems to be a bug that
sometimes manifests in edge cases as explained in GH pull request #651,
instead of using a more complicated awk script (as in OpenLDAP) drop it
altogether (as in GCC) and presume the only practical effect to be
elimination of the bug unless proven otherwise.
Have mkdep take a -s argument, giving the source directory, and have it
prepend that directory to all source files before running them through
the compiler's make-dependencies operation.