Have you looked at build2[1]? One of its main goals is to not make this mistake.
[1] https://build2.org