# Makefile for VPP Fortran 90 
#   Fortran 90 compiler works only in the background.
#                           $Id: makefile.UNIX_System_V,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/FSUNvpp/bin/frtpx -X9 -Free
F77   = /opt/FSUNvpp/bin/frtpx -X7 -Fixed -Oe
FFLAG = -I./ -Pdlt -A2m -Elmipue -Oe -c -Wv,-md
OPT_PARA = -K fast -Wx
VPPLD  = /usr/local/bin/vppld -Oe
#CHKCPULIB = -L./ -lelaps
CHKCPULIB = -L/usr/local/lib -lelaps

CPP   = /usr/ccs/lib/cpp -P -C

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

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

OBJECTS = $(OBJECTSF90) $(OBJECTSF77)

$(TARGET) : $(OBJECTS)
	time $(VPPLD) -o $@ $(OBJECTS) $(CHKCPULIB) ; date

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

.f90.o:
	$(F90) $(FFLAG) -Z $*.list $*.f90
#	$(F90) $(FFLAG) $(OPT_PARA) -Z $*.list $*.f90

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

.F.o:
	$(CPP) $(P_FLAGS) <$*.F >$*.f
	$(F77) $(FFLAG) -Z $*.list $*.f

.f.o:
	$(F77) $(FFLAG) -Z $*.list $*.f

