On Fri, 2026-08-14 at 10:02 +0200, Gisle Vanem wrote:
> Since there was no rule to create '$(OBJ_DIR)/config.h',
> but '$(OBJ_DIR)/win-config.h', I'd wish the error-message
> could be:
>
> gnumake: *** No rule to make target 'objects/Config.obj',
> needed by 'bin/kddocwidgets-x64.dll' since there's no rule
> to create '$(OBJ_DIR)/config.h'.
> Stop.
>
> Is there an option for this? If not, would that be wanted or
> possible?
Apologies to everyone for my absence from the mailing list this summer.
Due to some firewall changes at my work I've not been able to reply to
email using my GNU account during working hours, and my availability
outside of work has been severely limited.
Gisle: the problem with your suggestion is that there is not only one
possible way to build a target, using pattern rules. The way pattern
rules work is that if a rule doesn't match, that's not an error.
Instead we continue to search for other patterns that match. Only if
ALL patterns fail to match, do we have an error that there's no rule to
build a target.
Every pattern rule that we attempt will fail for a different reason.
For example, there are built-in rules that attempt to build an object
file like .o from C source files, C++ source files, Fortran source
files, etc. If we cannot find a rule to build a target foo.o, what
would we put in the error message about this?
Listing all the possible "missing" prerequisites doesn't seem right; in
fact it seems like it would create more confusion.
We could provide a special case where if there was exactly one pattern
rule that matched then we would print the extra information. However,
that would usually fail since there are pattern rules that match every
target ("match-anything rules").
--
Paul D. Smith <[email protected]> Find some GNU Make tips at:
https://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad
Scientist