I compile a big project: I run a compilation and it fails with "unfinished jobs" error When I make clean /clobber it fails in another place with the same error?
What is the difference between clean and clobber for compiling? And how the problem descrined above cold be solved?
The Makefile author creates targets and gives them human-readable names; conventionally, clean means to remove things from a previous build, while clobber means to forcibly overwrite some previous results.
The make clean command allows you to get rid of objects and executable files. The compiler, at times, will compile or link files incorrectly, which may cause issues. The only way to have a new start is by removing all the objects and the executable files. If you do not run make clean, you keep your old object files.
make distclean is the first step up from the basic make clean on many GNU Make systems. It seems to be pseudonymous or at least very similar to with make realclean and make clobber in many, but not all cases. It will delete everything that make clean does and remove the configuration.
Keith is right, clean and clobber can mean whatever the author of the makefile wants them to.
In practice though I think typically the difference between the two is this:
clean
: deletes all the object files createdclobber
: deletes all the object files AND the intermediate dependency files generated which specify the dependencies of the cpp files.At least that has been the case in the projects I have worked on.
I think you're saying that you run the command
make clean
or
make clobber
These are targets specified in your Makefile
. Their meaning is determined by what the Makefile says; they're not predefined. Typically they'd both remove files (executables, object files) generated when you compile. The difference, if any, between clean
and clobber
depends on the whim of the author of the Makefile
.
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