makefile别名

veh*_*zzz 3 makefile

请在下面的makefile中解释$ @ $ ^ $

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)
Run Code Online (Sandbox Code Playgroud)

t0m*_*13b 7

这就是这两个符号的含义:

  • $ @是目标即 test
  • $ ^是规则的先决条件列表(在本例中是指定的扩展通配符列表SRC=$(wildcard '*.c'))

所有这些变量都在GNU make手册的Automatic variables页面中解释.