How to add multi line comments in makefiles

前端 未结 6 1867
野的像风
野的像风 2021-01-30 03:32

Is there a way to comment out multiple lines in makefiles like as in C syntax /* */ ?

6条回答
  •  既然无缘
    2021-01-30 04:17

    Not exactly what you're looking for, but similar in spirit. I don't expect it to be the accepted answer, but maybe it can help someone.

    Assuming you're editing your makefiles in VIM:
    Either decide which lines you want to comment or select them with 'v'.

    Then you can use the regex s/^/#/ to comment out the lines
    and s/^#// to revert them.

    --Notes--

    • To open the vim command line, press : (colon)
    • To prep the command for the next 'n' lines, use .,+n
    • A sample line using "v" looks like: '<,'>s/^/#/

提交回复
热议问题