CC       = cc -Dtc2000
FC       = f77 -nopar
AR       = ar
RM       = rm
RANLIB   = ranlib
SHELL    = /bin/sh
LINKER   = cc
# Pick these based on main program language
CLINKER = cc
FLINKER = f77
# Blas libraries
BLAS1 =
BLAS2 =
BLAS3 = 
BLAS  =
LAPACK = $(ITOOLSDIR)/libs/libs$(BOPT)/tc2000/liblapack.a

.SUFFIXES:
.SUFFIXES: .a .o .c .f .F .C

# We need to put in the exact location of gnumake so that we can execute
# this from the restricted shell.
lib: $(SOURCE) 
	for i in $(OBJS) ; do /usr/local/bin/gnumake libmember LIBMEMBER=$$i ; done
	ranlib $(LIBNAME)

libbuild: $(SOURCE) 
        for i in $(OBJS) ; do make libmember LIBMEMBER=$$i ; done
# liball is a version that builds the source files all at once and then
# adds them, again all at once, to the archive.  Because of the poor
# performance of some archive programs, this can significantly improve
# the speed of an original installation.
liball: $(SOURCEC) $(SOURCEF)
	if [ "$(SOURCEC)" != "" ] ; then \
	     $(CC) -c $(CFLAGS) $(BASEOPT) $(SOURCEC) ;\
	fi
	if [ "$(SOURCEF)" != "" ] ; then \
	     $(FC) -c $(FFLAGS) $(BASEOPTF) $(SOURCEF) ;\
	fi
	$(AR) clq $(LIBNAME) $(OBJS)
	$(RM) $(OBJS)
	

libmember: $(LIBNAME)($(LIBMEMBER))

deletelibs:
	if (test -w $(LIBNAME)) then $(RM) $(LIBNAME) ; fi

lint:
	lint -cvhu -DLINT $(SOURCE)
lintlib:
	lint -cvhu -DLINT -Cltmp $(IFLAGS) $(SOURCE)
	mv llib-lltmp.ln $(LIBBASE).ln

.c.a:
	$(CC) -c $(CFLAGS) $(BASEOPT) $*.c
	$(AR) cr $(LIBNAME) $*.o
	rm -f *.o
.f.a:
	$(FC) -c $(FFLAGS) $(BASEOPTF) $*.f
	$(AR) cr $(LIBNAME) $*.o
	rm -f *.o
.c.o:
	$(CC) -c $(CFLAGS) $(BASEOPT) $*.c
.f.o:
	$(FC) -c $(FFLAGS) $(BASEOPTF) $*.f
