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
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
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/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.
To my understanding, it’s simply to save disk space. After compiling some programs 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
- after cloning the
gitrepo, the source takes 53 160 kB
- after the configure run it’s 53 632 kB
- after compilation, we have more than 10 times the initial value: 673 668 kB
make cleanreduces this to 53 636 kB
- and finally after
make distcleanwe are nearly at the level right after the cloning: 53 188 kB
Why the libvpx step uses
make clean instead of
At the time of writing the guide libvpx had no rule in its
Makefile for the target
clean was used instead.
make (dist)clean is included after
make clean is included after each
make install simply as a precautionary measure to provide a “clean slate” for users who go back, change configure options, and re-compile (which occurred more often than expected).
In a previous version of the compile guide, without the preventative
make distclean, one of these users would on occasion encounter unexpected results.
make clean gives an error?
Makefile:198: Makefile: No such file or directory make: *** No rule to make target '/tests/Makefile'. Stop.
make: *** No rule to make target 'distclean'. Stop.
Ignore it. It just means you likely ran
make distclean twice which is harmless.