开发者

Makefile while loop

Even after setting SHELL to bash instead of sh, the following does not work:

doc:
    while read line; do \
      eval echo "$$line" > $(DOC) \
    done < $(DOC).templ

/bin/bash: -c: line 3: syntax 开发者_StackOverflow中文版error: unexpected end of file

What I'm trying to do is have a template file with bash parameter comprehensions and such ($(), ${}) and "build" it at compile time. Is there a better way to do this?


You are missing a semicolon before done:

doc:
    while read line; do \
      eval echo "$$line" > $(DOC); \
    done < $(DOC).templ


This answer might come to late ;-), but I think another problem is that your output redirection is in the wrong position:

doc:
    while read line; do \
      eval echo "$$line"; \
    done < $(DOC).templ > $(DOC)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜