[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "make maintainer-clean" inconsistency
From: |
Eli Zaretskii |
Subject: |
Re: "make maintainer-clean" inconsistency |
Date: |
Fri, 09 Aug 2024 16:40:04 +0300 |
> Date: Fri, 9 Aug 2024 14:31:19 +0200
> From: Patrice Dumas <pertusus@free.fr>
>
> On Thu, Aug 08, 2024 at 08:46:37PM +0100, Gavin Smith wrote:
> > When I run "make maintainer-clean", there is a difference depending
> > on whether it is an out-of-source build.
>
> My feeling is that maintainer-clean in an out of source build does not
> make much sense, and that we should not support it. But that's a wild
> guess, I have never seen anything on that in the documentations and
> that's a subject I do not know much about.
>From the GNU Coding Standards manual:
'maintainer-clean'
Delete almost everything that can be reconstructed with this
Makefile. This typically includes everything deleted by
'distclean', plus more: C source files produced by Bison, tags
tables, Info files, and so on.
The reason we say "almost everything" is that running the command
'make maintainer-clean' should not delete 'configure' even if
'configure' can be remade using a rule in the Makefile. More
generally, 'make maintainer-clean' should not delete anything that
needs to exist in order to run 'configure' and then begin to build
the program. Also, there is no need to delete parent directories
that were created with 'mkdir -p', since they could have existed
anyway. These are the only exceptions; 'maintainer-clean' should
delete everything else that can be rebuilt.
The 'maintainer-clean' target is intended to be used by a
maintainer of the package, not by ordinary users. You may need
special tools to reconstruct some of the files that 'make
maintainer-clean' deletes. Since these files are normally included
in the distribution, we don't take care to make them easy to
reconstruct. If you find you need to unpack the full distribution
again, don't blame us.
To help make users aware of this, the commands for the special
'maintainer-clean' target should start with these two:
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
FWIW, I agree that this makes very little sense outside of the source
tree, because a better way in that case is simply to remove the build
tree, or switch to a clean tree for the subsequent build.