Dear All,

In my makefile I have a target to create a text file. My requirement is 
something like this. 
I would like to generate the file with 10 words in each line. I tried 
defining a function as follows

define WRITE_TO_FILE
@i=1;j=$(MAXWORDS);\
while [ $$i -lt $(words $(1)) ]  ; do \
echo $$i $$j;\
BG=$(wordlist $$i,$$j,$(1));\
i=`expr $$i + $(MAXWORDS)` ;\
j=`expr $$j + $(MAXWORDS)` ;\
done
endef

When I run gmake I get the following error.

common.mk:1009: *** non-numeric first argument to `wordlist' function: 
'$i'.  Stop.

With $(MAXWORDS) set to 10 I get the following output if I remove the line 
starting BG=
1 10
11 20
21 30
31 40

Any ideas on how do I get around this problem?

Thanks & Regards,
Bhaskar

Corporate I&T / Design Technology & Flows | NXP Semiconductors India Pvt 
Ltd | Manyata Tech Park |  Nagawara | Bangalore 560 045
E-mail: [EMAIL PROTECTED] | Phone: +91 80 4024 7282 | Fax: +91 80 4024 
7852 | GSM: +91 99007 82999 | Internet: http://www.nxp.com/ 

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to