CC       = cc -Ddec5000
FC       = f77
AR       = ar
RM       = rm
RANLIB   = ranlib
SHELL    = /bin/sh
LINKER   = f77 
# Pick these based on main program language
CLINKER = cc
FLINKER = f77
SLIB     = -L/lib/cmplrs/f772.1 -lF77 -lI77 -lU77
# Blas libraries
BLAS1 =
BLAS2 =
BLAS3 = 
BLAS  =
LAPACK = $(ITOOLSDIR)/libs/libs$(BOPT)/dec5000/liblapack.a

libbuild: $(SOURCE)
	for i in $(OBJS); do make libmember LIBMEMBER=$$i ; done
lib: $(SOURCE)
	for i in $(OBJS); do make libmember LIBMEMBER=$$i ; done
	ranlib $(LIBNAME)
libmember:    $(LIBNAME)($(LIBMEMBER))
# 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)
	

# This doesn't work since it wants to make ) or <lastname>.o)
#lib: $(SOURCE) $(LIBNAME)($(OBJS) )
#	ranlib  $(LIBNAME)
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) $*.o
.c.o: 
	$(CC) -c $(CFLAGS) $(BASEOPT) $*.c
.f.o: 
	$(FC) -c $(FFLAGS) $(BASEOPTF) $*.f
.f.a: 
	$(FC) -c $(FFLAGS) $(BASEOPTF) $*.f
	$(AR) cr $(LIBNAME) $*.o
	$(RM) $*.o
