# $Id: rules,v 1.62 2001/08/28 18:27:13 balay Exp $ 
#
#     See the file bmake/base_variables.defs for a complete explanation of all these fields
#

libc: ${LIBNAME}(${OBJSC})
libf: ${LIBNAME}(${OBJSF})


#############
shared_arch: shared_solaris

#
#  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
#
#  The ${PETSC_LIB} -lC is too tell the linker the location of the libC.a 
#  library and force it to include those symbols into the shared library.
#  Since there is no .so version of the libC.a it must be done this way.

include ${PETSC_DIR}/bmake/common/rules.fortran.cpp
include ${PETSC_DIR}/bmake/common/rules.shared.basic

oshared: 
	-@${RM} -rf tmp; \
	mkdir tmp; \
	cd tmp; \
        echo "building ${LIBNAME}.${SLSUFFIX}"; \
	${AR} x ../${LIBNAME}.a ;\
	${LD} -G  -h ${LIBNAME}.${SLSUFFIX} *.o  -o ../${LIBNAME}.${SLSUFFIX} \
               ${C_SYS_LIB} -lC ; \
	cd ../ ; \
	${RM} -rf tmp

