[Top][All Lists]

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

Re: How does $(error) work?

From: Björn Michaelsen
Subject: Re: How does $(error) work?
Date: Thu, 9 Dec 2010 19:55:12 +0100

Hi Chris,

Am Wed, 8 Dec 2010 14:20:03 -0500
schrieb Chris Cross <address@hidden>:

> Trying to understand how $(error) works. The manual says "error is
> generated whenever this function is evaluated."  With the makefile
> below I would expect to see output from line1 of the recipe but only
> see output from $(error).
> target:
>       @echo recipe line 1
>       $(error debug exit recipe line 2)
> $ make -f
> *** debug exit recipe line 2.  Stop.

Recipes are expanded (all $(eval) $(info) $(call) $(error) $(if)
$(shell)... statements) in the make-process before it is given (as a
job, thus maybe parallel to other jobs) to the shell to be executed
(with one or more calls depending on .ONESHELL). Because error aborts,
your recipe never gets to the second step.
If you think about it, it cannot be different: As for example $(eval)
changes the state of make (for example variables) it needs to run in
the make-process without parallelisation -- before the job is kicked
off itself.

Best Regards,


reply via email to

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