#                          $Id: makefile.SunOS,v 1.1.1.1 2004/06/26 11:21:37 yamasaki Exp $
SHELL = /bin/sh

.SUFFIXES:
.SUFFIXES: .o .F .f .F90 .f90 .mod

F90   = /opt/FSUNf90/bin/frt -X9 -Free
F77   = /opt/FSUNf90/bin/frt -X7 -Fixed
FFLAG = -Am -M./ -O3 -c

CPPDIR    = /opt/FSUNf90/lib
CPP       = $(CPPDIR)/cpp -P -C

SYSTEM    =  SUN
P_FLAGS   = -D$(SYSTEM) $(P_FLAGS0)

OBJECTSF90 = \
$(LOWER_MODULES) \
$(UPPER_MODULES) \
$(F_SUBROUTINES) \
$(F_OTHERSUBS)

OBJECTS = $(OBJECTSF90) $(OBJECTSF77)

$(TARGET) : $(OBJECTS)
	$(F90) $(OBJECTS) -o $@

$(UPPER_MODULES) $(F_SUBROUTINES):$(@:.o=.f90)


.f90.o:
	$(F90) $(FFLAG) $*.f90

.F90.o:
	$(CPP) $(P_FLAGS) <$*.F90 >$*.f90
	$(F90) $(FFLAG) $*.f90
	rm -f $*.f90

.F.o:
	$(F77) $(FFLAG) -Cpp $(P_FLAGS) $*.F

.f.o:
	$(F77) $(FFLAG) $*.f

$(OBJ_WALLCLOCK):$(@:.o=.c)
	cc -c $(@:.o=.c)
