I have a very large C project with many separate C files and headers and many dozens of contributors. Many contributors do not have a strong knowledge of makefiles and dependencies, resulting in the not uncommon problem where you almost always have to "make clean" before you can trust "make" to have produced correct output.
If make took minutes, this wouldn't be an issue, but it's nearly 2 hours on a fast machine now, and people are starting to check in code that works when they make, but they don't clean first and their code ultimately breaks the build. Don't ask why these aren't caught by the build manager before a new baseline is cut...
Yes, we shouldn't have let it go this far.
Yes, we're educating our developers.
As usual, we don't have time to stop everything and fix it by hand.
I'm thinking there are tools along these lines:
But what else can/should be done to resolve this issue?
Thanks in advance...
-Adam
It might be easiest to switch from Make to a tool which automatically detects dependencies. For example, SCons doesn't make you list dependencies but instead automatically parses the files being compiled and looks for includes. You simply specify which files should be compiled and which files go into which executables. Switching build systems will be easier for the fact that your developers aren't really Make experts.
Another alternative if you stick with Make is to use the gcc -M
option to automatically detect dependencies. The answer to the Automatically discovering C dependencies question has an example of how to have your makefiles automatically discover dependencies so that you don't need to specify them by hand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With