Reputation: 743
I'm trying to figure out what one specific line in a makefile is doing:
foo: smth_foo_depends_on
...
@echo $< | bar >> $@
...
In particular I'd like to know:
@
before echo
;$<
mean;$@
which, as far as I know, is the list of arguments given to the script? Why do we modify it?Thanks!
Upvotes: 2
Views: 1659
Reputation: 5315
Why do we write
@
beforeecho
?
Source: It is done to suppress the echoing for one specific line in the recipe.
What does
$<
mean?
Source: $<
is the name of the first prerequisite (i.e. smth_foo_depends_on
)
Why do we output something in
$@
which, as far as I know, is the list of arguments given to the script? Why do we modify it?
Source: In makefile language, $@
is the name of the current target (i.e. foo
). Do not confuse it with the shell list of positional parameters. The recipe line echo $< | bar >> $@
is expanded to:
echo smth_foo_depends_on | bar >> foo
Upvotes: 4