Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "@" mean in makefile?

Tags:

makefile

We offen use @echo "do..." to letting to print only do.... But who can tell me what is the mean of this condition ?

COUNT=$(shell ls | wc -l )

Then

@COUNT=$( shell ls | grep abc | wc -l )

What's the mean of the second?

like image 222
wuwl Avatar asked Aug 07 '13 13:08

wuwl


People also ask

What does $< $@ mean in makefile?

The $@ and $< are called automatic variables. The variable $@ represents the name of the target and $< represents the first prerequisite required to create the output file.

What does $$ mean in makefile?

This special significance of ' $ ' is why you must write ' $$ ' to have the effect of a single dollar sign in a file name or recipe. Variable references can be used in any context: targets, prerequisites, recipes, most directives, and new variable values.

What does the special symbol mean in makefile $@ $<?

Inside actions we can use: $@ to represent the full target name of the current target $? returns the dependencies that are newer than the current target $* returns the text that corresponds to % in the target $< returns the name of the first dependency $^ returns the names of all the dependencies with space as the ...

What is @echo in makefile?

The ' @ ' is discarded before the line is passed to the shell. Typically you would use this for a command whose only effect is to print something, such as an echo command to indicate progress through the makefile: @echo About to make distribution files.


2 Answers

It disables printing the command line being executed. Any output from the command itself still appears. See this previous question or see this Makefile reference.

like image 69
Spaceghost Avatar answered Sep 24 '22 10:09

Spaceghost


It will hide the output of the commandline when executing. Normally each command, when executing a rule, is printed to the console. This will suppress this output.

like image 4
Devolus Avatar answered Sep 22 '22 10:09

Devolus