What is the $@ symbol for in a makefile?

  • Thread starter Thread starter jf22901
  • Start date Start date
  • Tags Tags
    Symbol
AI Thread Summary
The discussion centers on the purpose of the automatic variable $@ in a Makefile dependency line. The user seeks clarification on its function within the context of a command that compiles an executable using the Intel Fortran compiler (ifort). The response highlights that $@ represents the target name of the rule, which in this case is the executable being created. A reference to the GNU Make manual is provided as a valuable resource for understanding automatic variables, leading to a positive acknowledgment from the original poster for the helpful information.
jf22901
Messages
55
Reaction score
1
Hi.

Can anyone please tell me what purpose $@ serves in the dependency line below? I've tried looking online, and in the make and ifort documentation, but can't find anything. :confused:

Code:
$(EXECUTABLE) : $(OBJECTS)
                ifort $(LOADFLAGS) -o $@ $(OBJECTS) $(LIBRARIES)

where:

OBJECTS = list of object files
LOADFLAGS = -O3 -align dcommons
LIBRARIES = -L$(LIBRARY) -lfft -lnetcdf

Many thanks. :smile:
 
Technology news on Phys.org
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top