bug-make
[Top][All Lists]
Advanced

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

Re: GNU make troubleshooting


From: Dmitry Goncharov
Subject: Re: GNU make troubleshooting
Date: Sat, 15 Jul 2023 16:16:22 -0400

> 1) The title, and what does the user want?
i guess, users want make to do the minimal amount of work required to
fulfil its duties correctly (e.g. track all dependencies, rebuilds,
etc).
This patch is not a full-fledged troubleshooting guide.
This patch describes how to minimize the work that make does and thus
reduce the amount of debug output.
But surely we can change the title.
How about "How to relieve make from redundant work and reduce the
amount of debug output."?

> "Understanding a Makefile's action w.r.t. a given file system state"),
> I do *not* want the state to be modified.
>
> Therefore, how about changing the example to use "make -n -d" instead of
> "make -d" ?
...
> This way, it's reproducible.

Sure.


> Hey, you are modifying the Makefile in order to analyze how it works!
Rather i am presenting different makefiles in order to demonstrate
these techniques that the patch describes.

The techniques that this patch describes
makefile::;
hello.d:;
MAKEFLAGS=-r
are all intended to relieve make from doing redundant work. This helps
performance.
The simplicity of debug output comes as the result of avoiding the work.


My opinion is that, large amounts of debug output is not the problem.
This output is simply make telling us what it does.
My opinion is that, the redundant work itself is the problem.
Once we relieve make from doing this work, the messages go away.
So, when the the number of debug lines changes from 1300 to 47 it is
really make doing that fraction of work.

> Is that really what I want to do and should do, as a user?
i believe, makefile authors should apply these techniques.

> Regarding -r, I would prefer to get told to add an option:

The users won't know and sometimes won't be able to modify the
makefile (e.g. make can be run by another program).
Once the makefile author knows the makefile does not need built-in
rules, they should add MAKEFLAGS=-r in the makefile and
this will do a good service to all their users.
The manual should lead by example.


> Can the addition of 'makefile::;' be replaced by a make option or
> by some (sed-based?) postprocessing?

There is no option.
You can grep away most of the matching lines with 'grep -v makefile'.


regards, Dmitry



reply via email to

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