Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

11.5 Backslash-Newline in Make Comments

According to Posix, Make comments start with # and continue until an unescaped newline is reached.

     $ cat Makefile
     # A = foo \
           bar \
           baz
     
     all:
             @echo ok
     $ make   # GNU make
     ok

However this is not always the case. Some implementations discard everything from # through the end of the line, ignoring any trailing backslash.

     $ pmake  # BSD make
     "Makefile", line 3: Need an operator
     Fatal errors encountered -- cannot continue

Therefore, if you want to comment out a multi-line definition, prefix each line with #, not only the first.

     # A = foo \
     #     bar \
     #     baz

 
 
  Published under the terms of the GNU General Public License Design by Interspire