Difference between `make clean` and `make distclean`

ffmpegmake

I installed ffmpeg from sources with help this page.
https://trac.ffmpeg.org/wiki/CentosCompilationGuide

I noticed that most of this tutorial calls make distclean after make install.
But only libvpx calls make clean after installing.

According this document,
http://www.gnu.org/software/automake/manual/automake.html#Clean
make clean deletes all files that make created, and make distclean deltes all files that ./configure created.

make clean

Erase from the build tree the files built by make all.

make distclean

Additionally erase anything ./configure created.

I understand that make distclean is called for for next installation,
but I could not understand why make clean is called after installation.

The installed ffmpeg works without problem.
So I asked this question because I only want to improve my knowledge about linux.
It would be very helpful that someone give me a explanation for it.

Best Answer

The parameter used after make is just dependent on the developer(s) who wrote the Makefile. The documentation you later reference, Autotools, is just one of many ways to create a Makefile.

The typical standard is make clean will remove all intermediate files, and make distclean makes the tree just the way it was when it was un-tarred (or something pretty close) including removing any configure script output. This is the way the Linux kernel works for instance.

In other words, it's totally dependent on the developers for each of those libraries, and this is why sometimes its clean and other times it's distclean. By the way, you don't need to run clean/distclean - I guess they have you run it just to save disk space. make install usually copies the files to the destination directory (again dependent on the developers) - typically places like /usr/lib or /usr/bin (also determined by the configure script, if it's an Autotools build system)

These nuances are the main reason people use package management systems like RPM or Debian packages.

Related Question