# makefile to build TestFigure and figure # # default: build TestFigure. It depends on two object files, which # make checks to make sure they are older than TestFigure TestFigure: TestFigure.o figure.o gcc -Wall -ansi -pedantic -g -o TestFigure TestFigure.o figure.o # build TestFigure.o. It depends on its source file and figure.h. # make checks to see whether the files it depends on have changed TestFigure.o: TestFigure.c figure.h gcc -Wall -ansi -pedantic -g -c TestFigure.c # build figure.o It depends on its source and header file # make checks their times figure.o: figure.c figure.h gcc -Wall -ansi -pedantic -g -c figure.c # clean up all object files and TestFigure (if it exists) clean: touch TestFigure; rm TestFigure rm *.o