(automake-1.16.info)Clean


Next: Dist Prev: Install Up: Top
Enter node , (file) or (file)node

13 What Gets Cleaned
********************

The GNU Makefile Standards specify a number of different clean rules.
Note: Standard Targets for Users.

   Generally the files that can be cleaned are determined automatically
by Automake.  Of course, Automake also recognizes some variables that
can be defined to specify additional files to clean.  These variables
are ‘MOSTLYCLEANFILES’, ‘CLEANFILES’, ‘DISTCLEANFILES’, and
‘MAINTAINERCLEANFILES’.

   When cleaning involves more than deleting some hard-coded list of
files, it is also possible to supplement the cleaning rules with your
own commands.  Simply define a rule for any of the ‘mostlyclean-local’,
‘clean-local’, ‘distclean-local’, or ‘maintainer-clean-local’ targets
(Note: Extending).  A common case is deleting a directory, for
instance, a directory created by the test suite:

     clean-local:
             -rm -rf testSubDir

   Since ‘make’ allows only one set of rules for a given target, a more
extensible way of writing this is to use a separate target listed as a
dependency:

     clean-local: clean-local-check
     .PHONY: clean-local-check
     clean-local-check:
             -rm -rf testSubDir

   As the GNU Standards aren’t always explicit as to which files should
be removed by which rule, we’ve adopted a heuristic that we believe was
first formulated by François Pinard:

   • If ‘make’ built it, and it is commonly something that one would
     want to rebuild (for instance, a ‘.o’ file), then ‘mostlyclean’
     should delete it.

   • Otherwise, if ‘make’ built it, then ‘clean’ should delete it.

   • If ‘configure’ built it, then ‘distclean’ should delete it.

   • If the maintainer built it (for instance, a ‘.info’ file), then
     ‘maintainer-clean’ should delete it.  However ‘maintainer-clean’
     should not delete anything that needs to exist in order to run
     ‘./configure && make’.

   We recommend that you follow this same set of heuristics in your
‘Makefile.am’.


automatically generated by info2www version 1.2.2.9