How to add multi line comments in makefiles



Answers

I believe the answer is no. The only comment styling I can find is # for each line, or use \ to wrap the first line.

Question

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




define BOGUS
lines
.....
endef



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/^/#/



Links



Tags

makefile