Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed ffmpeg from sources with help this page.

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

According this document, 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.

share|improve this question
Make clean is called after installation to clean up. There is no need to keep compiled versions around in the directory where you compiled if you still have both the source (and thus can recreate those) and the installed program. – Hennes Aug 28 '13 at 19:02
The main reasoning behind providing the make distclean or make clean commands after installation is for users who plan on later updating the source code and re-compling since development of ffmpeg, and some of the libraries, is so active. The same commands are also listed in the "Updating" section of the guide, but it's mostly a safeguard since some people are surprisingly bad at following instructions or like to modify/ignore steps. – LordNeckbeard Aug 28 '13 at 19:42
up vote 15 down vote accepted

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 moves the files to the destination directory (again dependent on the developers) - typically places like /usr/lib or /usr/bin (also determined with 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.

share|improve this answer

To my understanding it's simply to safe disk space. After compiling some program you will have a lot of files, e.g. object files which are not needed anymore, because they are linked together in the binaries. All can be recreated by spending again some CPU time.

Take this example with the current ffmpeg code:

  • after cloning the git repo, the source takes 53 160 kB
  • after the configure run it's 53 632 kB
  • after compilation we have more than 10 times of the initial value: 673 668 kB
  • make clean reduces this to 53 636 kB
  • and finally after make distclean we are nearly at the level right after the cloning: 53 188 kB
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .