# $Id: rules,v 1.4 2001/08/22 17:57:34 balay Exp $ 

libc: ${OBJSC}
	${AR} ${AR_FLAGS} ${LIBNAME} ${OBJSC}
libf: ${OBJSF}
	${AR} ${AR_FLAGS} ${LIBNAME} ${OBJSF}

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

shared_arch: shared_linux
	-@cd ${SHARED_LIBRARY_TMPDIR}; \
	${AR} x ${INSTALL_LIB_DIR}/${LIBNAME}.${LIB_SUFFIX}; \
	${LD} -shared -soname,${LIBNAME}.${SLSUFFIX} -o ${INSTALL_LIB_DIR}/$$LIBNAME.${SLSUFFIX} *.o ${PETSC_EXTERNAL_LIB_BASIC}; \
	${RM} -f *

#
#  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} -shared  -all  ${LIBNAME}.a  -o ${LIBNAME}.${SLSUFFIX}  > /dev/null 2>&1 
