# $Id: base,v 1.17 1998/04/26 00:54:09 balay Exp $ 

#
#   If you do not have the XlC compiler then use the xlc compiler below
# we default to xlC since it generates faster code.
#
PARCH    = rs6000
CC       = xlC
#
#  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       = xlf 
AR       = ar
RM       = rm -f
RANLIB   = ranlib
OMAKE    = make
SHELL    = /bin/sh
# 
# Some systems may require instead
# CLINKER = xlc ${COPTFLAGS} -bI:/usr/lpp/xlf/lib/lowsys.exp 
# CLINKER = xlc ${COPTFLAGS}
# The next line is a hack for IBM SPx machines; you should remove it 
# if you are running on plain IBM RS6000 workstations and replace it
# with one of the above.
#
CLINKER  = mpcc ${COPTFLAGS} 
#
# Fortran programs MUST be linked statically (no shared libraries) for them
# to run on systems that haven't licensed a Fortran runtime or compiler.
# This used to be the default, but I've removed it since most system have
# licensed runtimes
#
# FLINKER = xlf ${FOPTFLAGS}
# The next line is a hack for IBM SPx machines; you should remove it 
# if you are running on plain IBM RS6000 workstations and replace it
# with the above.
#
FLINKER = mpxlf ${FOPTFLAGS}

SHELL   = /bin/sh
SYS_LIB = -lisode

# AIX apparently does not remotely resemble EITHER System V or BSD 4.x.
# By defining _POSIX_SOURCE , there is some hope that it will pretend that
# it is some form of Unix.

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})
#########

# This F.f rule ensures that the old *.f files are removed.
#
# If you are using the Gnu gcc or g++ compilers you must replace the 
# ${CC} below with xlc
#
.F.f:
	-${RM} $*.f __$*.c
	-cp $*.F __$*.c
	-${CC} ${CPPFLAGS} -E  __$*.c | grep -v '^ *#' > $*.f
	-${RM} __$*.c

.F.o:
	-${RM} $*.f __$*.c
	-cp $*.F __$*.c
	-${CC} ${CPPFLAGS} -E  __$*.c | grep -v '^ *#' > $*.f
	-${FC} -c ${FOPTFLAGS} ${FFLAGS} $*.f
	-${RM} $*.f __$*.c

.F.a:
	-${RM} $*.f
	-${CC} ${CPPFLAGS} -E $< | grep -v '^ *#' > $*.f
	-${FC} -c ${FOPTFLAGS} ${FFLAGS} $*.f
	-${AR} cr ${LIBNAME} $*.o
	-${RM} $*.o	$*.f

shared:
