# Makefile for Library of matrix functions
#
# (c) Copyright 1992. The Artificial Intelligence Laboratory, 
#     Massachusetts Institute of Technology, Cambridge, MA 02139.
#     All rights reserved.

.SUFFIXES: .o .c .a68 .b

INCS	=	-I/homes/xjyan/include
LIB	=	/homes/xjyan/lib/libmatrix.a
OBJS	=	matrix.o svdcmp.o \
		io.o xform.o banded.o \
		integra.o filter.o
SRCS	= 	matrix.c svdcmp.c \
		io.c xform.c banded.c \
		integra.c filter.c

CFLAGS = ${INCS} -O2 -g -Wall

all: libmatrix

libmatrix: ${OBJS}
	ar cruv ${LIB} ${OBJS}
	ranlib ${LIB}

.c.o: $*.c
	gcc -c ${CFLAGS} $*.c
ci: 
	ci "-r${REVISION}" -l *.c *.tex *.h Makefile ChangeLog

test.o: test.c /homes/xjyan/include/matrix.h
	gcc -c test.c ${INCS} ${CFLAGS}
 
test: test.o
	gcc -o test test.o -L/homes/xjyan/lib -lmatrix -lm

dist:   
	for i in `ls *.c Depend *.h Makefile ChangeLog `; \
	do \
		(echo "Doing $$i";\
		cp $$i ${DISTDIR}); \
	done

subdirsdist:
	for i in ${SUBDIRS}; \
	do \
	(cd $$i; echo "making $$i"; mkdir ${DISTDIR}/$$i; \
 	$(MAKE) "DISTDIR=${DISTDIR}/$$i" "VERSION=${VERSION}" dist); \
	done

# stuff to make dependencies

depend:
	makedepend $(DEPENDFLAGS) -- $(CFLAGS) $(CPPFLAGS) -- $(SRCS)

matrix.o: /usr/include/stdio.h /usr/include/ctype.h /homes/xjyan/include/matrix.h
matrix.o: /usr/include/math.h /usr/include/floatingpoint.h
matrix.o: /usr/include/sys/ieeefp.h
xform.o: /usr/include/stdio.h /usr/include/varargs.h /homes/xjyan/include/matrix.h
xform.o: /usr/include/math.h /usr/include/floatingpoint.h
xform.o: /usr/include/sys/ieeefp.h
banded.o: /usr/include/stdio.h /usr/include/ctype.h
banded.o: /homes/xjyan/include/matrix.h /usr/include/math.h
banded.o: /usr/include/floatingpoint.h /usr/include/sys/ieeefp.h
io.o: /usr/include/stdio.h /homes/xjyan/include/matrix.h /usr/include/math.h
io.o: /usr/include/floatingpoint.h /usr/include/sys/ieeefp.h
integra.o: /usr/include/stdio.h /homes/xjyan/include/matrix.h /usr/include/math.h
integra.o: /usr/include/floatingpoint.h /usr/include/sys/ieeefp.h
integra.o: /homes/xjyan/include/integrate.h
filter.o: /homes/xjyan/include/matrix.h /usr/include/math.h
filter.o: /usr/include/floatingpoint.h /usr/include/sys/ieeefp.h
