Please explain $@ $^ $ in the makefile below
LIBS = -lkernel32 -luser32 -lgdi32 -lopengl32
CFLAGS = -Wall
# (This should be the actual list of C files)
SRC=$(wildcard '*.c')
test: $(SRC)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
Please explain $@ $^ $ in the makefile below
LIBS = -lkernel32 -luser32 -lgdi32 -lopengl32
CFLAGS = -Wall
# (This should be the actual list of C files)
SRC=$(wildcard '*.c')
test: $(SRC)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
This is what these two symbols mean:
- $@ is the target i.e. test
- $^ expands the wild card list as specified in SRC=$(wildcard '*.c')