On Wed, Jan 19, 2022 at 2:56 AM Paul Smith <[email protected]> wrote:
>
> On Tue, 2022-01-18 at 10:14 +0800, Hongyi Zhao wrote:
> > But it seems that the `$?' used above can't obtain the exit status of
> > the code block in @(...) when used from outside the @() structure
> > [2].  So, I want to know if I can reliably obtain the exit status of
> > the code block in @(...) from outside the @() structure. Any hints
> > will be greatly appreciated.
>
> First, of course you must use $$? not $?, because $? is a shell
> variable not a make variable so you must escape it from make.
>
> Second, there's nothing magical about ().

This reminds me of the following similar problems when using GNU
Makefile variable assignment as discussed here [1]:

VAL = foo
VARIABLE = $(VAL)

In the above usage, can I also change to the following?

VAL = foo
VARIABLE = $$VAL

[1] 
https://programmer.help/blogs/gnu-makefile-variable-assignment-what-is-the-difference-between.html

Regards,
HZ

Reply via email to