Make a variable that has a default value of @
:
AT := @
And then use that in your Makefile
:
foo:
$(AT)fooc -o $@
Then run make
as make AT=
. You can get fancier than that, if you like:
V := 0
AT_0 := @
AT_1 :=
AT = $(AT_$(V))
This will make commands silent, unless V
is set to 1
(e.g., make V=1
). This uses the non-POSIX, but common feature of recursive variable expansion.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…