CC=g++ CFLAGS=-g -Wall EOBJS=testExpand.o matrixio.o default: testExpand all: testExpand testExpand: $(EOBJS) $(CC) -o testExpand $(EOBJS) # list of file dependencies matrixio.o: matrix.h matrixio.cpp testExpand.o: matrix.h testExpand.cpp # the following rule is used to compile .cpp files to .o .cpp.o: $(CC) $(CFLAGS) -c $< # the following removes all .o files, but leaves the executable clean: rm -f *.o testExpand