Subject: Re: arithmetic in make
To: None <tech-toolchain@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-toolchain
Date: 02/25/2007 15:38:14
> .for file in ${MYFILES}${n::=n}
> cp ${file} dir/${file}${n:[#]}${n::=$n n}
> .endfor
Ah! I wasn't aware of :[#]. I thought of counting in base 1, but
didn't know of any way to get the length of a variable.
I'll have to remember that.
Though - after seeing the remark about how this was for a cross-build
Makefile - I'm not sure that'll be portable enough.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B