ignoring at (@) symbol in makefiles

Viewed 6826

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)

6 Answers

Disabling the @ in front of a make script is useful, however sometimes it is too noisy when the make script is very long. Another debugging technique is to turn on a shell feature that echoes commands just before they execute. This obviates a need to manipulate @ or .SILENT. Consider an example Makefile:

test:
    @blah; \
    : ... lots of script commands ... ; \
    : Start debugging here ; \
    set -x; \
    : ... script segment to debug ... ; \
    set +x; \
    : Stop debugging here ; \
    : ... lots of script commands ... ;

This is likely non-portable since it depends on features present in the shell that executes the script, but portability is not really that important for debugging (if it works for you).

Related