[Top][All Lists]

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

[bug #58735] When rebuilding makefiles, make tries them in reverse order

From: Paul D. Smith
Subject: [bug #58735] When rebuilding makefiles, make tries them in reverse order
Date: Fri, 10 Jul 2020 15:36:43 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36

Follow-up Comment #5, bug #58735 (project make):

> If I provide more dependency information, gmake runs more commands in
parallel when in parallel mode and this will cause more problems since only
one of these commands needs to be run.

As discussed in the other bug, the right answer to this problem is to explain
to make what your target's recipes really do; hiding _more_ details from make
only make it less likely to perform the build correctly.

> The general problem is that gmake implements the include feature in a way
that is in conflict with the behavior of other, older implementations.

As I mentioned before, I'm not prepared to discuss decisions made by other
people 32+ years ago.  If you want to debate the appropriateness of that
decision you can reach out to Roland and Richard and have that conversation. 
My suspicion is that they had their own ideas of how "include" should work,
and didn't think that the fact some other existing (proprietary, at the time)
make's "include" worked differently should keep them from implementing a
better method.  But, you'll have to ask them.

At this point the disparity has existed for the aforementioned 32+ years and I
have no interest in breaking GNU make makefiles in an effort to resolve it.

> You did not verify that the specific behavior of gmake is needed by any
makefile in the public.

Unless I'm misunderstanding your description of the behavior, using it would
break every GNU make makefile where the rule to create the include file
appeared _after_ the include line itself.  So every makefile that currently

include inc1.mk
inc1.mk: ; echo FOO = bar > $@

or anything similar, will break.

> I just ask you to introduce orthogonal behavior in gmake and to evaluate
existing rules for include files the same way as it is done for Makefiles:
just before the file is opened the first time.

I think there's some confusion.  GNU make only has one algorithm to rebuild
makefiles.  There's no difference in behavior for the initial makefile,
makefiles specified on the command line, or included makefiles: they all are
handled identically.

If there is no initial makefile, then obviously there are no other include
files to build and make must rely completely on built-in rules.  However, it
still follows exactly the same steps as when an initial makefile already

1) Try to load the makefile, don't fail if it doesn't exist
2) Set the goal target(s) to all makefiles (just Makefile in this case)
3) Try to rebuild those files
4) If any file needs to be rebuilt but cannot be, then:
   * If it was not included with -include or sinclude, fail
5) If any makefile was updated, start over from scratch.
6) Else, run the build


Reply to this item at:


  Message sent via Savannah

reply via email to

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