CC       = cc -I/usr/include -I/usr/local/include/CC -Dc2mp
FC       = fc -72
AR       = ar
RM       = rm
RANLIB   = ranlib
SHELL    = /bin/sh
LINKER   = fc 
# Pick these based on main program language
CLINKER = cc
FLINKER = fc
# Blas libraries
BLAS1 = $(ITOOLSDIR)/libs/libs$(BOPT)/c2mp/blas.a
BLAS2 = $(BLAS1)
BLAS3 = $(BLAS2)
BLAS  = $(BLAS3)
LAPACK = $(ITOOLSDIR)/libs/libs$(BOPT)/c2mp/liblapack.a

libbuild: $(SOURCE)
	for i in $(OBJS) ; do /usr/bin/make ARCH=c2mp BOPT=$(BOPT) libmem LIBMEMBER=$$i ; done
#### make libmem ; \

lib: $(SOURCE)
	for i in $(OBJS) ; do /usr/bin/make ARCH=c2mp BOPT=$(BOPT) libmem LIBMEMBER=$$i ; done

libmem: $(LIBNAME)($(LIBMEMBER))
	echo $(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)

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) $*.c

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

