# Makefile - generated by mkmk, Version 1.0
# Author = Seongjai Kim, skim@ms.uky.edu
# Sun Nov 12, 1900  05:13:19 PM
#----------------------------------------------
# Define macros used for compiling and linking 
#----------------------------------------------

CC  = gcc
CPP = g++
F77 = f77
F90 = f90

#OSTYPE=linux
#---------------
OPTC  = -O2
OPTCPP= -O2
OPTF  = -O2
OPTF90= -O2

BLASDEF =
#BLASDEF = -DUSE_VENDOR_BLAS

INC_CPP = 
INC_C   = 
INC_F90 = 
INC_F   = 
LNK_LIB = -lg2c -lm -lgcc -lc

#C preprocessor defs (-DNoChange, -DAdd_, or -DUpCase)
CDEFS =
#CDEFS = -DNoChange

PREFLAGS= $(CDEFS) $(BLASDEF)
CFLAGS  = $(OPTC) $(PREFLAGS)
CPPFLAGS= $(OPTCPP) $(PREFLAGS)
FFLAGS  = $(OPTF) $(PREFLAGS)
F90FLAGS= $(OPTF90) $(PREFLAGS)

#Main=C++
#---------------
COMP = $(CPP)
FLAG = $(CPPFLAGS)

MYINC =
MYLIB =
#MYINC = -I$(HOME)/c++/include
#MYLIB = -L$(HOME)/c++/lib

#----------------------------------------------

SRCS = Main.cpp cwrite.c dot_prod.c ilu0.c ilu0C.c ilu0_subst.c IOset.c pcg_ilu0.c pcg_ilu0C.c diffusion.f dualmesh.f etimef77.f euler.f evalCell.f fwrite.f getht.f getvel.f getxbar.f initial.f inputs.f matrix3.f mtxvec.f pmm.f ptprint.f reaction.f rk4.f setcommons.f timemarch.f transport.f

OBJS = Main.o cwrite.o dot_prod.o ilu0.o ilu0C.o ilu0_subst.o IOset.o pcg_ilu0.o pcg_ilu0C.o diffusion.o dualmesh.o etimef77.o euler.o evalCell.o fwrite.o getht.o getvel.o getxbar.o initial.o inputs.o matrix3.o mtxvec.o pmm.o ptprint.o reaction.o rk4.o setcommons.o timemarch.o transport.o

HDRS = A.h B.h commons.h

#----------------------------------------------
# Things to make                               
#----------------------------------------------

xx yy zz: $(OBJS) $(SRCS) Makefile
	$(COMP) -o $@ $(FLAG) $(OBJS) $(MYLIB) $(LNK_LIB)

debug:
	$(COMP) -g -c $(SRCS)
	$(COMP) -g -o xx $(OBJS) $(MYLIB) $(LNK_LIB)

clean clear:
	/bin/rm -f core *.trace *.bak *.o a.out xx yy zz
sep ps numerical out:
	/bin/rm -f core *.trace *.bak *.sep* *.ps fort.*
bak rmbak:
	/bin/rm -f *.bak

#-------------------------------------------------

.SUFFIXES : .o .a .c .C .cc .cpp .cxx .f .F .f90 

.C.o .cc.o .cpp.o .cxx.o: 
	$(CPP) -c $(INC_CPP) $(CPPFLAGS) $(MYINC) $< 
.c.o: 
	$(CC) -c $(INC_C) $(CFLAGS) $(MYINC) $< 
.F.o .f90.o: 
	$(F90) -c $(INC_F90) $(F90FLAGS) $< 
.f.o: 
	$(F77) -c $(INC_F) $(FFLAGS) $< 


Main.o: Main.cpp A.h B.h
	$(CPP) -c $(INC_CPP) $(CPPFLAGS) $(MYINC) Main.cpp

inputs.o: inputs.f commons.h
	$(F77) -c $(INC_F) $(FFLAGS) inputs.f

matrix3.o: matrix3.f commons.h
	$(F77) -c $(INC_F) $(FFLAGS) matrix3.f

setcommons.o: setcommons.f commons.h
	$(F77) -c $(INC_F) $(FFLAGS) setcommons.f
