ignoring at (@) symbol in makefiles

后端 未结 6 1137
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 09:20

In makefiles, a line prefixed with an at symbols disables the print of the output. I have a makefile where every line is prefixed with an at, but for debug I need to see wha

6条回答
  •  猫巷女王i
    2020-12-15 09:23

    To make things even more configurable, allow a make switch to enable verbosity. It default normal to silent mode. Only with the -e VERBOSE=1 mode it will be verbose of course:

    ##
    # Verbose ENABLE/DISABLE
    # invoke make -e VERBOSE=1
    ##
    V=@
    ifeq ($(VERBOSE),1)
        V=
    endif   
    
    all:
        $(V)echo test
        echo test
    

    Thank you for this topic it was of great help for my work.

提交回复
热议问题