Describe what files are needed to build an app
Describe how to build the app
Can avoid unnecessary compilations
Documents file dependencies
Supports multiple targets
Good for managing libraries
all: myapp
CC = gcc
CFLAGS = -g -Wall -ansi
MYLIB = mylib.a
myapp: main.o $(MYLIB)
$(CC) -o $@ main.o $(MYLIB)
$(MYLIB): $(MYLIB)(2.o) $(MYLIB)(3.o)
main.o: main.c a.h
2.o: 2.c a.h b.h
3.o: 3.c a.h c.h