26

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?

3 Answers 3

37

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.)

16

You can use make --silent (at least for GNU make)

3

To tell Make to be quiet/silent for all the targets, put the following at the top of a Makefile, which will work as though make --silent was used without requiring one to provide the switch on command line.

Works with GNU Make on Linux, I am not sure about all the other Make variants.

MAKEFLAGS += --silent

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.