CC = cc
CFLAGS = -O
DEFINES =
FILES = csr.c csr.h ftime.c ftime.h matrix-test.c mdata.c Makefile

UNAME = `uname -n`

mtest: matrix-test
	./matrix-test

matrix-test: matrix-test.o csr.o mdata.o ftime.o
	$(CC) $(CFLAGS) $(DEFINES)  -o matrix-test matrix-test.o csr.o mdata.o ftime.o

csr.o:	csr.c csr.h
	$(CC) $(CFLAGS) $(DEFINES) -c csr.c
mdata.o: mdata.c csr.h
	$(CC) $(CFLAGS) $(DEFINES) -c mdata.c
matrix-test.o: matrix-test.c csr.h ftime.h
	$(CC) $(CFLAGS) $(DEFINES) -c matrix-test.c

ftime.o: ftime.c ftime.h
	$(CC) $(CFLAGS) $(DEFINES) -c ftime.c
csr.s: 	csr.c csr.h
	$(CC) $(CFLAGS) $(DEFINES) -S csr.c -o csr.s

csr.tar:  $(FILES)
	tar cvf csr.tar $(FILES)

clean:
	rm -f *.o matrix-test
