bug-make
[Top][All Lists]
Advanced

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

Re: 4.3: -p: exit status is 2


From: Paul Smith
Subject: Re: 4.3: -p: exit status is 2
Date: Fri, 18 Dec 2020 19:02:39 -0500
User-agent: Evolution 3.36.4-0ubuntu1

On Sat, 2020-12-19 at 00:04 +0100, Steffen Nurpmeso wrote:
> While finding a way to truly detect whether being run by BSD make
> (which cannot supervise a shell script that turns on "set -m" to
> monitors its childs) i stumbled upon the fact that
> 
>   $ make -p
> 
> exits 2.

Yes.  The manual says specifically:

> Print the data base (rules and variable values) that results from
> reading the makefiles; then EXECUTE AS USUAL OR AS OTHERWISE
> SPECIFIED.

(emphasis added).  If you examine the output you'll see that you got an
error:

  make: *** No targets specified and no makefile found.  Stop.

and the manual says:

> 2
> The exit status is two if make encounters any errors. It will print
> messages describing the particular errors.

so this is as expected.

I guess there is some issue with the documentation here since the error
message is actually shown before the database is printed while the
documentation implies that the database will be printed first.

> Even if i follow the manual advice
> 
>   $ make -p -f /dev/null
> 
> i get complains (bad manual advice!),

I don't see why it's bad advice.  The advice doesn't say that it will
run with a 0 exit code, it just says that if you want to see the
default targets, without any targets defined by your makefile, you can
try using "-f /dev/null".

>   $ echo all: > y.mk; make -p -f y.mk

You don't need to make a file: you can do something like this:

  $ echo 'all:;' | make -p -f-




reply via email to

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