#=======================================================================
#  MASTER MAKEFILE FOR ZEUS CODE
#
#-------------------  object files  ------------------------------------
OBJ    = bval.o     \
	 bvalemf.o  \
	 dataio.o   \
	 findno.o   \
	 ggen.o     \
	 intchk.o   \
	 hdfall.o   \
	 magpres.o  \
	 mocct.o    \
	 moctf.o    \
	 momx1.o    \
	 momx2.o    \
	 momx3.o    \
	 movie.o    \
         msave.o    \
	 mstart.o   \
	 nudt.o     \
	 pdv.o      \
	 printd.o   \
	 printz.o   \
         resist.o   \
         restart.o  \
	 setup.o    \
	 srcstep.o  \
	 strtoi.o   \
	 transprt.o \
	 tranx1.o   \
	 tranx2.o   \
	 tranx3.o   \
	 viscus.o   \
         visphys.o  \
	 vtos.o     \
	 x1intfc.o  \
	 x1intzc.o  \
	 x2intfc.o  \
	 x2intzc.o  \
	 x3intfc.o  \
	 x3intzc.o  \
	 zeus3d.o   \
	 checkin.o  \
	 bcdflt.o
#-------------------  macro definitions  -------------------------------
.SUFFIXES:
.SUFFIXES: .src .c .f .o
EXEDIR = ../exe/
SPEC   = special
PROB   = shkset
FC     = f77 
OPTS   = -c -O3
CC     = cc 
LDR    = f77
LIB    = /usr/local/lib/libmfhdf.a /usr/local/lib/libdf.a \
	/usr/local/lib/libjpeg.a /usr/local/lib/libz.a
#--------------------  implicit rules  ---------------------------------
.src.o:
	/lib/cpp -P -traditional $< > $*.f
	${FC} ${OPTS} $*.f 
.c.o:
	${CC} -c $<
#---------------------  targets  ---------------------------------------
help:
	@echo Type 'make compile' to generate ZEUS-2D executable
	@echo Type 'make clean'   to remove *.f and *.o files
#-----------------------------------------------------------------------
clean:
	rm *.o *.f
#-----------------------------------------------------------------------
compile: ${OBJ} ${PROB}.o ${SPEC}.o
	${LDR} -o ${EXEDIR}zeus3d.exe ${OBJ} ${PROB}.o ${SPEC}.o ${LIB}

${PROB}.o: ${PROB}.src
	/lib/cpp -P -traditional ${PROB}.src > ${PROB}.f
	${FC} ${OPTS} ${PROB}.f

${SPEC}.o: ${SPEC}.src
	/lib/cpp -P -traditional ${SPEC}.src > ${SPEC}.f
	${FC} ${OPTS} ${SPEC}.f
