# $Id: rules,v 1.65 2001/08/22 17:57:34 balay Exp $ 
#
libc:
	for i in ${OBJSC}; do ${OMAKE} BOPT=${BOPT} LIBNAME=${LIBNAME} libmember LIBMEMBER=$$i ; done

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

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

###################
# Need to build libpetscfortran as a shared library as well, 
# as-fast option produces bad .a files
#
shared: chkopts_basic
	-@echo making shared libraries in ${INSTALL_LIB_DIR} ;\
	cd ${INSTALL_LIB_DIR}; \
	for LIBNAME in ${SHLIBS} ; \
	do \
          if [ -f ${INSTALL_LIB_DIR}/$$LIBNAME.a ]; then \
	    flag=""; \
	    if [ -f ${INSTALL_LIB_DIR}/$$LIBNAME.${SLSUFFIX} ]; then \
              flag=`find ${INSTALL_LIB_DIR} -follow -type f -name $$LIBNAME.a -newer ${INSTALL_LIB_DIR}/$$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; \
	  fi; \
	done

#
#  Generates a shared library from any .a library; not just the PETSc ones
#  This is to allow any user to generate his or her own shared library
#

oshared: 
	-@echo "building $$LIBNAME.${SLSUFFIX}"
	-@${LD} -elf -no_library_replacement -shared -rdata_shared \
	            -all  ${LIBNAME}.a  -o ${LIBNAME}.${SLSUFFIX} ;
#
# Notes:
#
# -lpthread is required by AMS package. It should follow -lmpi, hence, is specified
# in the variable SYS_LIB. If libpthread.so is not avilable on this machine, you can
# comment out this line.
#
# -trapuv initializes memory with NaNs, so that uninitialized errors are caught.

# For IRIX version less than 6.2, 
#         replace "-OPT:Olimit=5000" with "-OPT:fprop_limit=5000"
#	On Origin2000 Some PETSc files are not compiled with -O3.
#	  replace -O3 with -O2 to compile these files.

#	IF your O2K has ip25 processor, please change
#       ip27 to ip25
#
#COPTFLAGS  = -OPT:Olimit=6000 -Ofast=ip27
#FOPTFLAGS  = -Ofast=ip27 -IPA:cprop=OFF -OPT:IEEE_arithmetic=1
#
# Some examples crash (ts/ex/tests/ex1f) with the cprop optimization
