tech-userlevel archive

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

bmake and loop variable expansion



The following typescript shows how loop variables unlike all others are
expanded in bmake. As far as I can see this is not documented in bmake
manual page.  Can I feel PR or sombody can fix the following paragraph?

================================

     Variable substitution occurs at two distinct times, depending on where
     the variable is being used.  Variables in dependency lines are expanded
     as the line is read.  Variables in shell commands are expanded when the
     shell command is executed.

================================
$ cat /home/cheusov/tmp/3.mk
.for i in 1 2 3
a+=     ${i}

j=      ${i}
b+=     ${j}
.endfor

all:
        @echo ${a}
        @echo ${b}
$ nbmake -f /home/cheusov/tmp/3.mk
1 2 3
3 3 3
$

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index