[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Target-specific Variable Values
From: |
ali hagigat |
Subject: |
Re: Target-specific Variable Values |
Date: |
Sat, 11 Dec 2010 17:16:34 +0330 |
Dear Eli,
Thank you. It worked. Another question is about the extract of make manual:
--------------------------------------
5.1 Recipe Syntax
A variable definition in a “rule context” which is indented by a tab
as the first character on the line, will be considered part of a
recipe, not a make variable definition, and passed
to the shell.
--------------------------------------
I have the following makefile:
all: file1
file1:
var1=wwwww;echo $var1
@echo lllllll
The result was:
var1=wwwww;echo ar1
ar1
lllllll
Why var1 can not be printed correctly? Does make considers two
different shells for (var1=wwwww) and (echo $var1)?
How can i have a variable assignment for each command of a recipe?
Regards
On Sat, Dec 11, 2010 at 4:46 PM, Eli Zaretskii <address@hidden> wrote:
>> Date: Sat, 11 Dec 2010 14:14:13 +0330
>> From: ali hagigat <address@hidden>
>>
>> all: file1 ;@echo $far1
>> file1: far1 = yuuuuu
>> file1:
>> @echo $far1
>> @echo lllllll
>>
>> ar1
>> lllllll
>> ar1
>> ----------------------------------------------------
>> Why the second rule does not print the value of far1?
>
> Because $far1 is not a reference to a Make variable. Try $(far1)
> instead.
>