Tech Journal Back to Tech Journal

How can I get a Makefile to print/echo text during a make?

Simplest way is to just call the shell to do it. Like this:

@echo "message"

If you have more than 1 line to output, you can call the shell with a lot of stuff, by using line-continuation, and the shell's semi-colon operator:

@\
echo "line1" ;\
echo "line2" ;\
echo ""
Last updated on 2005-08-08 14:00:00 -0800, by Shalom Craimer

Back to Tech Journal