Possible Duplicate:
arithmetic in a Makefile
I'm very much a beginner using Makefile. I would like to update a variable, like this more or less:
LEVEL=0
train:
while (eval_score > previous_eval_score)
make iterate
iterate:
do stuff
write files to /path/to/$(LEVEL)/asdf.txt
$(LEVEL)++
In other words, every iteration writes some files to a directory, first to /path/to/0, then /path/to/1, etc. until some threshold is reached.
So apparently it's not allowed to update or reassign a variable inside a function. I have searched for a while now but can't find any satisfactory answers. Maybe I have but I don't understand everything. I have also tried stuff like calculating in bash but eventually I still have to update the variable. Perhaps I should try something like update a file instead and for every iteration, just read from the file?
Thanks for your time.