On Tue, 2018-08-21 at 06:32 +0000, Mark Galeck wrote:
> Then why does the error say "make: ***" ? Shouldn't Make be more
> robust and assertive in such a case, if a child crashes, to inform
> the user that it is not Make code?
That's the format that make uses when it shows that the recipe of a
target failed, regardless of how it failed.
If the command exited with an error code (rather than dumped core), it
$ cat Makefile
sometarget: ; exit 22
make: *** [Makefile:1: sometarget] Error 22
If the command exits with a signal, it will say that instead of "Error
22". If the command exits with a core dump, then it says that.
In general make doesn't know what actual command was running. Usually
make invokes the shell and passes a string to that shell and the shell
runs it, and make doesn't know what actual commands that string is
running when it exits. So make prints the target name, not the
command. In the case of a program exiting with a core dump of course
make knows which command dumped core (it's whatever program make
invoked) but still make keeps the same syntax and behavior to be
> Does the error message as it is, is it not _exactly_ the same as if
> Make itself crashed? If so, then how is the user to know, whether
> this is a bug or not?
If make dumps core then it's up to the command that INVOKED make to
tell you about it. Make cannot tell you about it... it dumped core!
It's up to the invoking program as to how it displays information that
its child dumped core. If you invoke the command from the shell, for
example, then you get something like:
> I can't tell my users "hey, if this happens, read Make source to find
> out if it is really Make bug".
If you get a core dump and you don't know which program failed then the
best thing to do is to use file(1) on the core file to see which
program dumped core:
$ file core.12343
core.12343: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from 'badprogram'
But in general, if you see an error message in the format of standard
make errors ("make: ***") then you know it was not that make program
itself that failed, but rather the program that make invoked.