Hi Mark,

On 11/21/24 7:44 PM, Mark Wielaard <m...@klomp.org> wrote:

>  Hi Michael,
>  
>  On Tue, Nov 19, 2024 at 04:18:17AM +0000, Michael Pratt wrote:
>  >
>  > >  This is because config/eu.am defines a default CLEANFILES. So those
>  > >  Makefile.am files should add to CLEANFILES with += instead of
>  > >  redefining CLEANFILES with =.
>  >
>  > May I suggest to instead simply use
>  > "DISTCLEANFILES" for what is in eu.am?
>  > It's not being used anywhere else currently...
>  
>  But aren't DISTCLEANFILES only remove for make distclean?  The *.gcno
>  *.gcda could be added to MOSTLYCLEANFILES since you would normally
>  want to regenerate them. I am not sure that would resolve your issue
>  though.

You would be a better judge of when the files
should be removed, I'm not as familiar with their purpose.

I was imagining that only maintainers
or only those who develop like the maintainers would bother with these files,
so making it closer to the "maintainer-clean" target would be good enough.

Since the DISTCLEANFILES variable is currently unused
it would be one way to resolve the issue,
although provided that it's not added elsewhere later... so maybe not the best 
step.

>  > If that's no good, I would then like to see a '+='
>  > in all the "*CLEANFILES" definitions in each level for each file
>  > so it's not confusing or looking like a possible mistake.
>  
>  You mean even for MAINTAINERCLEANFILES and MOSTLYCLEANFILES? and even
>  for those (config/Makefile.am ./Makefile.am doc/Makefile.am) that
>  don't include eu.am (and also don't use CLEANFILES, except for the
>  top-level one)?

The Makefile.am files that don't include eu.am
also don't have "CLEANFILES" variables...
except for the top-level one...

Ironically, the CLEANFILES definitions
in both eu.am and the top-level Makefile.am
seem to be for the same purpose which is coverage files...

Further simplification can also be a solution to this,
so I'm going to send a small patch set for you all to consider.
It's likely a better idea than the 3 ideas presented here so far.

>  The "rule" now seems to be:
>  - When you use CLEANFILES you should now always use +=.
>  = MAINTAINERCLEANFILES and MOSTLYCLEANFILES uses =.
>  
>  Is that "rule" really that confusing?

It's not written anywhere that this is the case
so someone seeing this for the first time
would have to do some digging to see why it is there
provided that they realize there is a good reason for it.
I think several people including myself
see the subdirectories as independent
and would consider the list of files to clean
being independent to logically follow from that.

I don't really see it as a rule,
rather just an inconsistency.
It just happens to be the way that the first person
to write these cleaning steps happen to do so
when there's really many ways to write it.

And again, I'm sorry for not noticing this earlier.
For whatever reason I didn't see the pattern,
and the '+=' looked unnecessary at first glance,
also since some other instances of the '+=' I saw
were because of other lines in the same file in other cases.

For me, a rule would be to write the rules
the most simple way whenever possible,
leading to simpler and smaller automake usage.

--
MCP





Reply via email to