# $Id: base,v 1.39 1998/04/25 23:32:40 balay Exp $ 

PARCH    = IRIX5
CC       = cc -32
#
#  Indicates the version of the compiler you are using; if you do not know
#  how to get the version number then use: unknown
#
CCV      = unknown
#
FC       = f77 -32
AR       = ar
RM       = rm -f
#
# the  following is used to convert petsclib into dynamic libraries 
#
#RANLIB   = ${PETSC_DIR}/bmake/${PETSC_ARCH}/make_dso_IRIX ${LDIR}
RANLIB	 = true
OMAKE    = make
SHELL    = /bin/sh
#
# -rpath is required to specify the location of any dynamic libraries
# which are not found in the standard locations (/lib:/usr/lib:) etc
#
CLINKER  = cc  -32 ${COPTFLAGS} -rpath ${LDIR}:${DYLIBPATH}
FLINKER  = f77 -32 ${FOPTFLAGS}   -rpath ${LDIR}:${DYLIBPATH}

SYS_LIB  = -lfpe -lsun 
#
#  For SGI 64 bit machines use the PETSC_ARCH IRIX64
#
SHELL    = /bin/sh

include ${PETSC_DIR}/bmake/common

libc:
	for i in ${OBJSC}; do ${OMAKE} BOPT=${BOPT} libmember LIBMEMBER=$$i ; done

libf:
	for i in ${OBJSF}; do ${OMAKE} BOPT=${BOPT} libmember LIBMEMBER=$$i ; done

libmember:    ${LIBNAME}(${LIBMEMBER})

############

.F.o:
	-${FC} -c ${FOPTFLAGS} ${FFLAGS} ${CPPFLAGS} $*.F

.F.a: 
	-${FC} -c ${FOPTFLAGS} ${FFLAGS} ${CPPFLAGS} $*.F
	-${AR} cr ${LIBNAME} $*.o
	-${RM} $*.o

shared: chkopts_basic
	-@echo making shared libraries in ${LDIR} ;\
	cd ${LDIR}; \
	for LIBNAME in ${SHLIBS} ; \
	do \
	  flag=""; \
	  if [ -f ${LDIR}/$$LIBNAME.${SLSUFFIX} ]; then \
              flag=`find ${LDIR} -type f -name $$LIBNAME.a -newer ${LDIR}/$$LIBNAME.${SLSUFFIX} -print`; \
	  else \
	      flag="true"; \
	  fi; \
          if [ "$$flag" != "" ]; then \
	    echo "building $$LIBNAME.${SLSUFFIX}"; \
	    ${LD} -elf -no_library_replacement -shared -rdata_shared \
	      -all  $$LIBNAME.a  -o $$LIBNAME.${SLSUFFIX} ; \
	  fi; \
	done
