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 what's going on. Is there a way to tell make to ignore the at and output the line ? the debug is excessive, and the -n option prints them, but does not do anything (it's for dry run)
The variable $@ represents the name of the target and $< represents the first prerequisite required to create the output file.
The @ symbol is commonly seen at the beginning of an action lines and means that the action line itself is not be be echoed on the screen as it is executed. Macros are commonly used in makefiles to decrease the amount of typing required.
$$ means be interpreted as a $ by the shell. the $(UNZIP_PATH) gets expanded by make before being interpreted by the shell.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With