What is the meaning of ‘@’ in Makefile?

Harry asked:

What is the meaning of ‘@’ in Makefile? An example is as follows.

$ cat Makefile
all:
    @echo "For correctness test of basic get and put, run: make test;"

Without ‘@’, it works well.

Without @:

$ make
echo "For correctness test of basic get and put, run: make test;"
For correctness test of basic get and put, run: make test;

With @:

$ make
For correctness test of basic get and put, run: make test;

The difference is clear: with @, make will not print out the command that it executes.

Answered by Eric Z Ma.

Got it, thank you.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *