Merge branch 'minor'
[automake.git] / lib / am / clean.am
blobe4a7fdb25f5e9f5aacc6428568df5579a3fd9141
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2017 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 ## We must test each macro because it might be empty, and an empty "rm
18 ## -rf" command looks disturbing.  Also, the Solaris 2.4 "rm" will
19 ## return an error if there are no arguments other than "-f".
20 mostlyclean-am: mostlyclean-generic
21 mostlyclean-generic:
22 %MOSTLYCLEAN_RMS%
24 clean-am: clean-generic mostlyclean-am
25 clean-generic:
26 %CLEAN_RMS%
28 distclean-am: distclean-generic clean-am
29 distclean-generic:
30         -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
31         -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
32 %DISTCLEAN_RMS%
34 ## Makefiles and their dependencies cannot be cleaned by
35 ## an -am dependency, because that would prevent other distclean
36 ## dependencies from calling make recursively.  (The multilib
37 ## cleaning rules do this.)
39 ## If you change distclean here, you probably also want to change
40 ## maintainer-clean below.
41 distclean:
42         -rm -f %MAKEFILE%
44 maintainer-clean-am: maintainer-clean-generic distclean-am
45 maintainer-clean-generic:
46 ## FIXME: shouldn't we really print these messages before running
47 ## the dependencies?
48         @echo "This command is intended for maintainers to use"
49         @echo "it deletes files that may require special tools to rebuild."
50 %MAINTAINER_CLEAN_RMS%
52 ## See comment for distclean.
53 maintainer-clean:
54         -rm -f %MAKEFILE%
56 .PHONY: clean mostlyclean distclean maintainer-clean \
57 clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic
59 ?!SUBDIRS?clean: clean-am
60 ?!SUBDIRS?distclean: distclean-am
61 ?!SUBDIRS?mostlyclean: mostlyclean-am
62 ?!SUBDIRS?maintainer-clean: maintainer-clean-am