$@ : target
$^: prerequisite 清單
所以如果
%.o : %.c
cc -c $(CFLAGS) $^ -o $@
會build 所有的.c 再 output .o
`%' matches any nonempty substring
In order for the pattern rule to apply, its target pattern must match the le name under consideration, and its prerequisite patterns must name les that exist orcan be made.
沒有留言:
張貼留言