The for loop and other commands run in a shell, they can't affect makefile variables. I think the following will do what you want:
Code:
forms := mainform colorname findform optionsform
uicodefiles := $(addsuffix .ui.h, $(forms))
moccedfiles := $(addprefix moc_, $(addsuffix .cpp, $(forms)))
formcode := $(addsuffix .cpp, $(forms)) $(addsuffix .h, $(forms))
If you do end up needing a loop, you should try the
foreach function.