[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $(info ...) in variable, with expansion in recipes
From: |
Yann Droneaud |
Subject: |
Re: $(info ...) in variable, with expansion in recipes |
Date: |
Tue, 08 Jul 2014 14:14:33 +0200 |
Hi,
Le vendredi 04 juillet 2014 à 12:36 -0700, Philip Guenther a écrit :
> This combination of behaviors is caused by the requirement that
> variables
> set on the make command-line are exported to the environment for
> commands
> by default.
>
> For a normal recursively expanded variable, the value placed in the
> environment has to be expanded completely before being placed in the
> environment. That expansion happens at the last moment, after the
> commands are expanded but before the shell is invoked. That explains
> the
> original example.
>
Thanks for the answer. I understand the way it works now.
> This can be confirmed by tell make that the RECIPE variable doesn't
> need
> to be exported. If you add this line to the Makefile:
> unexport RECIPE
>
> then the second '2' output goes away.
Thanks again, this is the perfect work around I was hoping for.
Here's the new makefile fragment:
ifeq ($(V),1)
Q :=
else
Q ?= @
endif
all:
$(Q) : $(info 1)
$(Q)$(eval unexport RECIPE)$(RECIPE)
$(Q) : $(info 3)
And the examples:
$ ./make -f ./info.mk RECIPE=': $(info 2)'
1
2
3
$ RECIPE=': $(info 2)' ./make -f ./info.mk
1
2
3
Regards.
--
Yann Droneaud
OPTEYA
- $(info ...) in variable, with expansion in recipes, Yann Droneaud, 2014/07/04
- Re: $(info ...) in variable, with expansion in recipes, Yann Droneaud, 2014/07/04
- Re: $(info ...) in variable, with expansion in recipes, Etan Reisner, 2014/07/04
- Re: $(info ...) in variable, with expansion in recipes, Yann Droneaud, 2014/07/04
- Re: $(info ...) in variable, with expansion in recipes, Philip Guenther, 2014/07/04
- Re: $(info ...) in variable, with expansion in recipes, Etan Reisner, 2014/07/04
- Re: $(info ...) in variable, with expansion in recipes,
Yann Droneaud <=
- Re: $(info ...) in variable, with expansion in recipes, Philip Guenther, 2014/07/08
- Re: $(info ...) in variable, with expansion in recipes, Yann Droneaud, 2014/07/15
- Re: $(info ...) in variable, with expansion in recipes, Etan Reisner, 2014/07/04