Re: [PATCH] lib/readline/doc makefiles clean targets

2024-11-01 Thread Chet Ramey

On 10/29/24 1:04 PM, Mike Jonkmans wrote:

Hi Chet et al.,

If I run, on devel (4917f285):
- ./configure
- make
- make clean
- git status

I would expect to see nothing special.
Instead:
a) a whole bunch of files got deleted in lib/readline/doc.


Yeah. Those files aren't part of the bash distribution, and so they get
cleaned. I left them there the last couple of pushes because I wanted
people to get a look at the documentation updates I made. It was easier
for me than splitting the files between the bash and readline devel
branches.



b) an untracked file appears: buildconf.h




The patch addresses a).
Not sure what to do about b). Could add to .gitignore or be cleaned.


It's a file configure creates, just like config.h, so it gets cleaned
with `make distclean'. I should add it to .gitignore, I suppose.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: [PATCH] lib/readline/doc makefiles clean targets

2024-11-01 Thread Mike Jonkmans
On Fri, Nov 01, 2024 at 01:25:46PM -0400, Chet Ramey wrote:
> On 10/29/24 1:04 PM, Mike Jonkmans wrote:
> > Hi Chet et al.,
> > 
> > If I run, on devel (4917f285):
> > - ./configure
> > - make
> > - make clean
> > - git status
> > 
> > I would expect to see nothing special.
> > Instead:
> > a) a whole bunch of files got deleted in lib/readline/doc.
> 
> Yeah. Those files aren't part of the bash distribution, and so they get
> cleaned. I left them there the last couple of pushes because I wanted
> people to get a look at the documentation updates I made. It was easier
> for me than splitting the files between the bash and readline devel
> branches.

Ok, i see.
Sort of a problem is, that these files aren't explicitly made by make.
So i guess these shouldn't be touched by any of the *clean targets.

According to info (make)Standard Targets, we should have:
mostlyclean < clean < distclean < maintainer-clean

In make rules, that would be:
maintainer-clean: distclean
# Delete (almost?) everything that this Makefile can make.
# e.g. info files, bison-c-code.
distclean: clean
# Remove files from configuring and building.
# Should leave only the files that were in the distribution.
clean: mostlyclean
# Remove the files that are made.
# But keep the files recording the configuration.
# Also keep files that come with the distribution.
mostlyclean:
# Like clean but excluding targets that are expensive to build.

(One could argue, whether the devel branch is a distribution.)

Anyways, I see some Makefiles with:
mostlyclean: clean
which should be reversed.

Would you accept patches for:
a) reversing mostlyclean/clean;
b) rewrite mostlyclean/clean/distclean as described;
c) rewrite maintainer-clean so that it reuses the other clean-targets.


> > b) an untracked file appears: buildconf.h
> > 
> > The patch addresses a).
> > Not sure what to do about b). Could add to .gitignore or be cleaned.
> 
> It's a file configure creates, just like config.h, so it gets cleaned
> with `make distclean'. I should add it to .gitignore, I suppose.

Yes, adding builconf.h to .gitignore would be nice.

I guess that config.h, buildconf.h etc. - products of running configure 
or config.status - are 'files recording the configuration'.
Thus should be exempt from 'make clean mostlyclean'.

-- 
Regards, Mike Jonkmans