CC=g++
CFLAGS=-g -Wall
TOBJS=test.o matrixio.o

default: test

all: test

test: $(TOBJS)
	$(CC) -o test $(TOBJS)

# list of file dependencies
matrixio.o: matrix.h matrixio.cpp
test.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