CC=g++ CFLAGS=-g -Wall TOBJS=test.o matrix.o default: test all: test test: $(TOBJS) $(CC) -o test $(TOBJS) # list of file dependencies matrix.o: matrix_proxy.h matrix.h matrix.cpp test.o: matrix.o matrix.h test.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 test