makefile - GNU Make: "dir not expected at this moment" -
i have makefile including following lines:
buildrepo: @$(call make-repo) define make-repo dir in $(c_srcs_dir); \ \ mkdir -p $(objdir)/$$dir; \ done endef
on line commands for dir in $(c_srcs_dir); \
following error message:
"dir not expected @ moment" make: *** [buildrepo] error 255
i using gnu make
.
can tell me going wrong?
actually for ... in ... ; ... done
statement unix command not gnu make command, therefore guess using windows machine (or other one). have find equivalent system.
but gnu make has foreach function works :
$(foreach dir,$(c_srcs_dir),mkdir -p $(objdir)/$(dir);)
also note in specific case (not related gnu make windows) can create dirs without for/foreach loop, :
mkdir -p $(addprefix $(objdir)/,$(c_srcs_dir))
Comments
Post a Comment