From GNU make documentation
Re-compilation should be performed if the source file or any of the header files called dependent are later than the object file, or if the object file does not exist.
It does not change your Makefile, which runs it.
make clean deletes all object files that were created at the same time. As a rule, there is no need to partially recompile, i.e. Only recompile the files that you changed, and finally associate the newly created object files with existing ones. However, if you want to be completely safe, you must run make clean before running make .
An example where saving old object files (i.e. never cleanup) can be a problem: suppose you have an existing object file that must be associated with version 1.0 of some library. Now you are updating your computer, and version 1.1 will be installed on it, where some function is incompatible with function 1.0. But since your object file was compiled in anticipation of the previous version, the linking process will ultimately fail.
source share