I have ;
default : gcc -o function function.c
When I type make in terminal, following message is emitted
user@user-laptop:~/Desktop$ make gcc -o function function.c user@user-laptop:~/Desktop$
But I want
user@user-laptop:~/Desktop$ make user@user-laptop:~/Desktop$
How can I do that?
If you want to inhibit the display of commands during a particular make run, you can use the -s option. If you want to inhibit the display of all command lines in every run, add the special target . SILENT to your makefile .
The ' @ ' is discarded before the line is passed to the shell. Typically you would use this for a command whose only effect is to print something, such as an echo command to indicate progress through the makefile: @echo About to make distribution files.
The $@ and $< are called automatic variables. The variable $@ represents the name of the target and $< represents the first prerequisite required to create the output file. For example: hello.o: hello.c hello.h gcc -c $< -o $@ Here, hello.o is the output file.
Use an @
to quiet the output:
default: @gcc -o ...
You can find the documentation here: Recipe echoing. (Or you can invoke make
with make -s
to suppress all echoing.)
You can use make --silent
(at least for GNU make)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With