bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Chet Ramey
Subject: Re: [PATCH] lib/readline/doc makefiles clean targets
Date: Thu, 7 Nov 2024 18:05:36 -0500
User-agent: Mozilla Thunderbird

On 11/4/24 9:44 AM, Mike Jonkmans wrote:

According to info (make)Standard Targets, we should have:
     mostlyclean < clean < distclean < maintainer-clean
That hierarchy isn't gospel.

Agreed, but...

The current Makefile rules are fine.

There are some issues though. Some less important.
1) After 'make distclean', it doesn't build: some .o files need y.tab.h.

y.tab.h isn't part of the devel branch, you need bison to build it, and
it is included in the bash distributions. I see the problem here, though.
I'll figure out a way to fix it that's compatible with it being included
and not without too many release-specific changes.

The fundamental difference is that the devel branch and the master
(distribution) branch contain different files, and serve different
purposes from a common source base, and the existing Makefiles are
built for the master branch. That's why, for instance, the distclean
target in doc/Makefile.in removes the texinfo intermediate files -- they
are not part of the distributions. They appear in the devel branch for
convenience. I don't think their presence makes it any less easy to work
with the devel branch, though.

If you find yourself in this sitution, it's easy enough to remove
parser-built and y.tab.c and run make again before I fix it.


2) The use of recursive make, makes it harder to do dependencies right;

It's the best way to build using optional components and subdirectories.
If you have missing dependencies, send them along.

2a) Building outside of the source tree does not have proper deps;

As above.

3) The various Makefiles disagree on 'clean: mostlyclean' versus
    'mostlyclean: clean';

Is this substantive or just cosmetic?

4) .PHONY is not used for the sub-makes *clean rules;

You mean in the subdirectory makefiles?

5) git (status), .gitignore and make are disconnected;

What does this mean? There are a couple of files that I need to add
to .gitignore; is this something else?

6) There is redundancy/duplication in the actions of various rules;

OK.

6) Same for the definitions of variables.

Examples?

(One could argue, whether the devel branch is a distribution.)
It's not. It's a snapshot of ongoing work.

As such, it has the purpose of:
- bringing in early fixes/patches;
- communicating future changes, eliciting comments.

In many cases, yes. In some cases, I solicit discussion, usually here.


So the devel branch should be easy to work with for outsiders.

How would the standard make targets make it easier to work with (besides
fixing a couple of previously-discussed issues)? What are we doing here
beyond `configure; make' and testing out various behaviors?

That, in my opinion, would warrant more adherence to the
standard make targets.

Why?

It doesn't need to be religious,
perhaps stating deviations and/or documenting what the expectations
are on the various make-targets. INSTALL already has some text.

Are these `standard make targets' anything other than clean and
mostlyclean?


Are you often building from devel yourself? As maybe a check, in git,
on a push to devel, would be nice to have.

I always build the code I push to the devel branch from a clean tree
before I push it.


Anyway, I suppose that for the clean-targets (not maintainer-clean)
   git restore .; configure; make `clean-target'
should see no deleted/modified files in 'git status'.
This currently is not the case for mostlyclean and distclean.

Well, see above about the difference between the devel and master
branches.

There's a lot of stuff that's in the devel branch for convenience,
and some that's the opposite (y.tab.?). You can do some things with
.gitignore, but that's not enough for all the differences.

I do primarily build the devel branch in build directories different
from the source directory, and I always recommend doing that, so
maybe that masks some of the issues you're encountering.



Misc notes
- examples/loadables/Makefile(.in) has no mostlyclean target.
   The error is ignored, but clutters the output.

?

$ grep mostlyclean examples/loadables/Makefile.in
mostlyclean:    clean

- 'make mostlyclean' removes doc/bashref.* and doc/Makefile.

It shouldn't remove the Makefile, and you can make it again, but I can't
reproduce it removing the bashref.* files.


   No recovery, must run 'git restore doc; configure'.
- in doc/Makefile: the maybe-clean test should use realpath (cd ...; pwd -P)

I already made that exact change, actually, to match Makefile.in.


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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]