4

In Makefile, in commands of the form

all: @set -e; \ do more stuff

I know the set -e commands the shell to to exit on failure. What is the significance of the @ attached to set?

Lavya
  • 1,475
  • 2
  • 17
  • 21

1 Answers1

9

In a Makefile, the @ symbol means that the command is not echoed to the screen when it is run.

Tom Fenech
  • 72,334
  • 12
  • 107
  • 141
  • Thanks. Only the command to which it is sticked or also the commands following it? – Lavya Dec 10 '14 at 12:57
  • 2
    Only the command after the `@`. – Tom Fenech Dec 10 '14 at 12:58
  • 2
    It applies to the entire _logical line_ in the recipe. In your example you have used a backslash to combine two physical lines into a single logical line, so neither of those two commands (the `set -e` or the `do more stuff`) will be echoed. If you add another recipe line that is not connected to these with a backslash/newline, then that command _will_ be echoed. Just try adding and removing the `@` and see what happens. – MadScientist Dec 10 '14 at 14:20