# # + user variables # + automatic variables # compile flags CFLAGS=-Wall -g # link flags LFLAGS=-Wall -g # compiler CC=gcc # executable name EXE=talk # default target # $@ is target name, $^ is all sources $(EXE): main.o speak.o shout.o $(CC) $(LFLAGS) -o $@ $^ # individual source files # $< is the first source speak.o: speak.c speak.h $(CC) $(CFLAGS) -c $< shout.o: shout.c shout.h speak.h $(CC) $(CFLAGS) -c $< main.o: main.c speak.h shout.h $(CC) $(CFLAGS) -c $< clean: rm -f *.o $(EXE)