Suppress messages in make clean (Makefile silent remove)

后端 未结 5 2003
感情败类
感情败类 2021-01-30 13:10

I\'m wondering how I can avoid some echo in a Makefile :

clean:
    rm -fr *.o

this rule will print:

$>make clean   
rm -fr          


        
5条回答
  •  一整个雨季
    2021-01-30 13:34

    In fact I was looking for something else, adding this line to the Makefile :

    .SILENT:clean
    

    while execute every step of the "clean" target silently.

    Until someone point some drawback to this, I use this as my favourite solution!

提交回复
热议问题