Suppress echo of command invocation in makefile? Suppress echo of command invocation in makefile? linux linux

Suppress echo of command invocation in makefile?


Add @ to the beginning of command to tell gmake not to print the command being executed. Like this:

run:     @java myprogram

As Oli suggested, this is a feature of Make and not of Bash.

On the other hand, Bash will never echo commands being executed unless you tell it to do so explicitly (i.e. with -x option).


Even simpler, use make -s (silent mode)!


You can also use .SILENT

.SILENT: runhi:     echo "Hola!"run:     java myprogram

In this case, make hi will output command, but make run will not output.