Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clean vs. clobber

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?

like image 656
Yakov Avatar asked Aug 25 '12 00:08

Yakov


People also ask

What does make clobber do?

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.

What is make clean used for?

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.

What is make Distclean?

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.


2 Answers

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 created
  • clobber: 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.

like image 66
anio Avatar answered Oct 04 '22 04:10

anio


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.

like image 29
Keith Thompson Avatar answered Oct 04 '22 06:10

Keith Thompson