help-make
[Top][All Lists]
Advanced

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

Re: Can the exit status of the code block in @(...) be obtained from out


From: Paul Smith
Subject: Re: Can the exit status of the code block in @(...) be obtained from outside the @() structure?
Date: Wed, 19 Jan 2022 10:19:06 -0500
User-agent: Evolution 3.36.5-0ubuntu1

On Wed, 2022-01-19 at 19:47 +0800, Hongyi Zhao wrote:
> This reminds me of the following similar problems when using GNU
> Makefile variable assignment as discussed here [1]:

I recommend that people read the GNU make manual, rather than websites:

https://www.gnu.org/software/make/manual/html_node/Using-Variables.html

> VAL = foo
> VARIABLE = $(VAL)
> 
> In the above usage, can I also change to the following?
> 
> VAL = foo
> VARIABLE = $$VAL

I don't quite understand the question.  Of course you CAN do that.  If
your question is, does it mean the same thing then no, it does not.

The first one sets the value of the variable VARIABLE to the string
$(VAL) and the second one sets the value of the variable VARIABLE to
the string $$VAL.

These are definitely not the same: when $(VARIABLE) is expanded after
the first one, the expansion will be "foo" (without quotes).  When
$(VARIABLE) is expanded after the second one, the expansion will be the
literal string "$VAL" (without quotes).  So they're not the same.




reply via email to

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