There is a well-developed set of conventions about what utility
productions should be present and how they should be named.
Following these will make your makefile much easier to understand
and use.
Remove all files (such as binary executables and object files)
that are normally created when you make all. A
make clean should reset the process of building the
software to a good initial state.
dist
Make a source archive (usually with the
tar(1)
program) that can be shipped as a unit and used to rebuild the program
on another machine. This target should do the equivalent of depending
on all so that a make dist
automatically rebuilds the whole project before making the
distribution archive — this is a good way to avoid last-minute
embarrassments, like not shipping derived files that are actually
needed (like the flat-text README in
fetchmail, which is actually generated from an
HTML source).
distclean
Throw away everything but what you would include if you were
bundling up the source with make dist. This may be
the the same as make clean but should be included
as a production of its own anyway, to document what's going on. When
it's different, it usually differs by throwing away local
configuration files that aren't part of the normal make
all build sequence (such as those generated by autoconf(1);
we'll talk about autoconf(1) in Chapter17).
realclean
Throw away everything you can rebuild using the makefile. This
may be the same as make distclean, but should be
included as a production of its own anyway, to document what's going
on. When it's different, it usually differs by throwing away files
that are derived but (for whatever reason) shipped with the project
sources anyway.
install
Install the project's executables and documentation in system
directories so they will be accessible to general users (this
typically requires root privileges). Initialize or update any
databases or libraries that the executables require in order to
function.
uninstall
Remove files installed in system directories by make
install (this typically requires root privileges). This
should completely and perfectly reverse a make
install. The presence of an uninstall production implies a
kind of humility that experienced Unix hands look for as a sign of
thoughtful design; conversely, not having an uninstall production is
at best careless, and (when, for example, an installation creates
large database files) can be quite rude and thoughtless.