# [1] Machine independent rules and definitions.
#==== ======= =========== ===== === ============
.SUFFIXES: .o .f .i .F

.f.o:
	$(CFT) -c $(FFLAGS) $*.f
.F.f:
	$(CPP) -P $(CPPFLAGS) $*.F | mpc > $*.f

.F.o:
	$(CPP) -P $(CPPFLAGS) $*.F | mpc > $*.f
	$(CFT) -nocpp -c $(FFLAGS) $*.f
#/bin/rm $*.f

.F:
	$(LDR) -o $@ $(FFLAGS) $(LDFLAGS) $<
.f:
	$(LDR) -o $@ $(FFLAGS) $(LDFLAGS) $<

# [2] Machine dependent definitions for SGI and SGI/CRAY Origin 
#==== ======= ========= =========== === === === ======== ======
# CPP           Name of the C preprocessor
# CPPFLAGS      Flags to the C preprocessor
# CFT           Name of the fortran compiler to use
# FFLAGS        Flags to the fortran compiler
# LDR           Program to load the objects into an executable
# LDFLAGS       Flags to the loader
#
# Specific for SGI Only
#--------- --- --- ----
# BINARY_TYPE   Type of executable file, either n32 or 64.
#
  BINARY_TYPE = n32

        SHELL = /bin/sh
           CC = cc
       INCDIR = ../lib$(BINARY_TYPE)
     CPPFLAGS = -DSGI -I$(INCDIR)
          CPP = /usr/lib32/cmplrs/cpp
          CFT = f77 -r8 -$(BINARY_TYPE) -mips4 $(CPPFLAGS)
#                 -TARG:platform=ip21:processor=r8000:madd=ON
          LDR = $(CFT) 

       FFLAGS = -O3 -TENV:X=3 

#     FFLAGS = -g -DEBUG:div_check=3:subscript_check=ON:trap_uninitialized=ON:verbose_runtime=ON

#      FFLAGS = -O3 -OPT:fold_arith_limit=2000 -TENV:X=3
#                   -OPT:Olimit=0:pad_common=OFF:reorg_common=OFF
#                   -OPT:fold_arith_limit=2000
#                   -GCM:aggressive_speculation=ON
#                   -SWP:=on:trip_count=2
#                   -TENV:large_GOT=ON -avoid_gp_overflow
#                   -LNO:opt=0

      LDFLAGS = -mp -mp_schedtype=simple
#                   -non_shared
         LCDF = $(INCDIR)/libnetcdf.a
         LMPI = -lmpi

      LIBNCAR = -L$(NCARG_ROOT)/lib -L/usr/local/lib -lncarg -lncarg_gks -lncarg_c -lX11
