How do I add comments (echo) in a Makefile that should be printed when run?
+2
A:
Since a makefile mostly contains commands to be run when building specific targets, I'd say you use just that: echo
.
Joey
2009-03-04 13:50:10
+1
A:
@All: there is no place for LMGTFY - it helps no-one, and is purely confrontational.
Marc Gravell
2009-06-24 21:27:51
+1
A:
Visual C++ nmake has the !message text...
preprocessing directive. I have not used GNU make, so I don't if it has it as weel, but quick search shows it has the $(info text...)
function.
And inside command blocks you can use echo
.
Franci Penov
2009-03-04 14:04:19
+8
A:
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!
Alnitak
2009-03-04 14:45:20