Adding comments to Makefile

前端 未结 5 913
时光取名叫无心
时光取名叫无心 2021-02-13 19:15

How do I add comments (with echo) in a Makefile so that they\'re printed when ran?

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-13 19:30

    You should use

    target:
         @echo "Building!"
    

    Note the @, which tells Make not to display the command itself. Without this the output would look like:

    echo "Building!"
    Building!
    

提交回复
热议问题