help-make
[Top][All Lists]
Advanced

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

Parsing command lines


From: Bhaskar G
Subject: Parsing command lines
Date: Fri, 16 May 2008 11:24:46 +0530


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: address@hidden | Phone: +91 80 4024 7282 | Fax: +91 80 4024 7852 | GSM: +91 99007 82999 | Internet: http://www.nxp.com/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]