Controlling verbosity of make

后端 未结 5 628
粉色の甜心
粉色の甜心 2021-02-04 11:10

I\'m using a makefile to compile a program made of many .c files, and any time make is invoked it only compiles those files modified after the last run

5条回答
  •  一生所求
    2021-02-04 11:17

    Instead of using "@gcc" to compile, you can omit that "@" and pass the "-s" option to your make command instead. (Leave "@echo" as it is.) Then "make -s" would be your brief make command, and "make" would be verbose.

    The ‘-s’ or ‘--silent’ flag to make prevents all echoing, as if all recipes started with ‘@’.

    From the GNU Make manual pages

    (The other answers better answer your question, but this approach deserves a mention.)

提交回复
热议问题