help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why sometimes @ prefix fails to suppress command echo?


From: Chen Jun (陈军)
Subject: Why sometimes @ prefix fails to suppress command echo?
Date: Mon, 5 Nov 2007 14:28:57 +0800

 
Hello, help-make
 
  I'd like to tell a strange behavior of make.
 
For GNU make 3.81 & 3.80. Can someone tell me why the running output from 'all' and 'all2' are different?
 
ifeq ($(SHOW_CMD),1)
  Q =
else
  Q = @
endif
 
define _DO_LINK
 echo "smash it."
 echo "smash done."
endef
 
all: 
 $(if $(SHOW_CMD),,@)$(_DO_LINK)
 
all2:
 @$(_DO_LINK)
{code}
 
Output:
 
$ make -f sn.mk
smash it.
echo "smash done."
smash done.
$ make all2 -f sn.mk
smash it.
smash done.
 
For target 'all', the @ suppress only the first command in $(_DO_LINK). Can this be make's bug?
 
 
 
 Best Regards
                 Chen Jun (陈军)
                       address@hidden
                       2007-11-05

reply via email to

[Prev in Thread] Current Thread [Next in Thread]