help-make
[Top][All Lists]
Advanced

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

New syntax of for loop


From: Mariusz Janczak
Subject: New syntax of for loop
Date: Fri, 7 Jan 2005 17:06:24 +0100

Dear all,

I have a problem with using for loop within makefile :(
I am triying to generate a variable size file filled up with dummy data:

forloop = $(shell for (( id=$(1) ; id>$(2) ; id-- )); do printf '\xff' >>
reserved.bin; done)

reserved.bin:
    @echo .. Creating $@ file ...
    $(shell echo -n > reserved.bin)
    $(call forloop, 10, 0)

The result of that is as follow:
    Syntax error: Bad for loop variable
    gmake: *** [reserved.bin] Error 2

I tired to use following command
    for (( id=10 ; id>0 ; id-- )); do printf '\xff' >> reserved.bin; done
directly from bash and it works.

Could you answer where is a mistake?

Best regards
--------------------------------------------------------------
Mariusz Janczak
--------------------------------------------------------------





reply via email to

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