INC_FILE=$(ROOT)/usr/avs/include/Makeinclude
include $(INC_FILE) 

# 
# NOTE:
# modify LASTFLIBS to include any fortran libraries necessary for the
# compilation of dispmopac
# use ar -t <libname> (can pipe into grep) to find what's archived in that lib
AVS_LIBS = $(ROOT)/usr/avs/lib
BASELIBS=-lgeom -lutil -lm 
FLOWLIBS=-L$(AVS_LIBS) -lflow_c $(BASELIBS) $(LASTLIBS)
CSIMLIBS=-L$(AVS_LIBS) -lsim_c $(BASELIBS) $(LASTLIBS)
F77LIBS=-lF77 -lI77 -lU77 -lisam
MODLIBS=-L$(AVS_LIBS) -lmdata -lmfilt -lmmapp -lmrend -lrf
F77_FLOWLIBS=-L$(AVS_LIBS) -lflow_f $(BASELIBS) $(LASTFLIBS)
F77_SIMLIBS=-L$(AVS_LIBS) -lsim_f $(BASELIBS) $(LASTFLIBS)
F77_BIND = $(ROOT)/usr/avs/bin/f77_binding
AVS_INC = -I.  -I/usr/include -I$(ROOT)/usr/avs/include
F77_INC = $(ROOT)/usr/avs/include
CFLAGS=$(ACFLAGS) $(AVS_INC) -g
F77FLAGS=$(AFFLAGS) -check_bounds
FFLAGS=$(F77FLAGS) 
AVS_EXE = $(ROOT)/usr/avs/bin/avs


#
# OBJS is the list of all object files that need to be linked into the
# executable.  If a new source file is added, then the corresponding
# object file name must be added to the list below.
#
OBJC=	dispmopac.o 

OBJF=	espwrapper.o 

SRCC=	$(OBJC:.o=.c)

SRCF=	$(OBJF:.o=.f)

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Targets:                                                                   #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#

dispmopac:	$(OBJC) $(OBJF)
		$(CC) -o dispmopac $(OBJC) $(OBJF) $(FLOWLIBS) $(F77LIBS)


#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#
# Next comes all of the source file names and their dependencies (if any)
# and specific compile options (if any).  If no specific compile options
# are listed, then the default specified above is used.  If a new source file
# is added, then an entry should be included below.
#
$(OBJC):		$(SRCC)
		$(CC) $(CFLAGS) -c $*.c

$(OBJF):		$(SRCF)
		$(F77) $(FFLAGS) -c $*.f


#
# This removes all object files when "make clean" is entered by the user.
#
clean:
	/bin/rm -f *.o