CC       = cc -DPARCH_IRIX -woff 1164 -woff 1048
FC       = f77
AR       = ar
RM       = rm -f
RANLIB   = true
OMAKE    = make
SHELL    = /bin/sh
CLINKER  = cc $(BASEOPT) -dont_warn_unused
FLINKER  = f77 $(BASEOPTF) -dont_warn_unused

SYS_LIB    = 
#
#  For SGI 64 bit machines make sure that -DHAVE_64BITS is listed below
#
CONF    = -DHAVE_PWD_H -DHAVE_STRING_H -DHAVE_STROPTS_H -DHAVE_MALLOC_H \
          -DHAVE_64BITS -DHAVE_X11 -DHAVE_FORTRAN_UNDERSCORE \
          -DHAVE_DRAND48  -DHAVE_GETDOMAINNAME \
          -DUSES_VOID_VOID_VOID_VOID_TSEARCH

SHELL   = /bin/sh

include $(PARPRE_DIR)/bmake/common

libc:
	for i in $(OBJSC); do $(OMAKE) libmember LIBMEMBER=$$i ; done

libf:
	for i in $(OBJSF); do $(OMAKE) libmember LIBMEMBER=$$i ; done

libmember:    $(LIBNAME)($(LIBMEMBER))

.c.a: 
	$(CC) -c $(CFLAGS) $(BASEOPT) $*.c
	$(AR) cr $(LIBNAME) $*.o
	$(RM) $*.o
.c.o: 
	$(CC) -c -DPARCH_IRIX $(CFLAGS) $(BASEOPT) $*.c
.C.a: 
	$(CC) -c $(CFLAGS) $(BASEOPT) $*.C
	$(AR) cr $(LIBNAME) $*.o
	$(RM) $*.o
.C.o: 
	$(CC) -c -DPARCH_IRIX $(CFLAGS) $(BASEOPT) $*.C
.f.o: 
	$(FC) -c $(FFLAGS) $(BASEOPTF) $*.f

.f.a: 
	$(FC) -c $(FFLAGS) $(BASEOPTF) $*.f
	$(AR) cr $(LIBNAME) $*.o
	$(RM) $*.o

.SUFFIXES: $(SUFFIXES) .F

.F.o:
	$(FC) -c $(PETSC_INCLUDE) $(FFLAGS) $(BASEOPTF) $*.F

.F.a: 
	$(FC) -c $(PETSC_INCLUDE) $(FFLAGS) $(BASEOPTF) $*.F
	$(AR) cr $(LIBNAME) $*.o
	$(RM) $*.o

# the IRIX is very picky about static functions they must be declared
# as static functions before being used otherwise it will use the 
# nonstatic one or have an unresolved symbol.

# The following appeared on the network on changing quiet NaNs to 
# signaling NaNs:
#        To do this on the SGI, you need to set the environment and load the
#floating point library.  When you are through, reset the environment.  The 
#following example will work quite nicely.  Refer to the man page for fpe for
#details.
#
##
## Trap floating pointing errors for overflows, invalid operations, and
##   divide by zero.  All underflows will be ignored and set to 0.0.
##
##      Overflow - set to NaN to avoid multiple overflows
##
#setenv TRAP_FPE "DEBUG; OVERFL =INF,COUNT,TRACE(10),EXIT(100); INVALID=IEEE,COUN
#T,TRACE(10),EXIT(100); DIVZERO=INF,COUNT,TRACE(10),EXIT(100)"
##
## compile and load with libfpe.a library
##
#f77 -g -C -o sample sample.f /usr/lib/libfpe.a
##
## execute
##
#sample  
##
## turn off trapping of floating point errors
##
#setenv TRAP_FPE="OFF"

