Multiline bash commands in makefile

后端 未结 5 1471
醉梦人生
醉梦人生 2020-11-27 11:57

I have a very comfortable way to compile my project via a few lines of bash commands. But now I need to compile it via makefile. Considering, that every command is run in it

5条回答
  •  渐次进展
    2020-11-27 12:36

    What's wrong with just invoking the commands?

    foo:
           echo line1
           echo line2
           ....
    

    And for your second question, you need to escape the $ by using $$ instead, i.e. bash -c '... echo $$a ...'.

    EDIT: Your example could be rewritten to a single line script like this:

    gcc $(for i in `find`; do echo $i; done)
    

提交回复
热议问题