May 11, 2006

Makefile

A typical Makefile with Patterns:

Pattern:

%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $<

$@: The target
$<: The name of the first prerequisite
$^: The names of all the prerequisites

Less common:

$?: The names of al lthe prerequisites that are newer than the target

No comments:

Post a Comment