############################################### # makefile5 (Pattern Rules) ############################################### ############################################### # Macros ############################################### CC = gcc # CC = gccmemstat CFLAGS = -Wall -ansi -pedantic # CFLAGS = -Wall -ansi -pedantic -g # CFLAGS = -Wall -ansi -pedantic -DNDEBUG # CFLAGS = -Wall -ansi -pedantic -DNDEBUG -O3 ############################################### # Pattern rules ############################################### %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< ############################################### # Build rules for non-file targets ############################################### all: testmymath clobber: clean rm -f *~ \#*\# core clean: rm -f *.o testmymath ############################################### # Build rules for file targets ############################################### testmymath: testmymath.o mymath.o $(CC) -o $@ $< mymath.o testmymath.o: mymath.h mymath.o: mymath.h