###########################################################################
#
# If you are unfamiliar with Makefiles:
#       Please follow the directions in this file carefully.  A Makefile
#       contains the set of rules necessary to correctly compile a project.
#
# 	Once you have customized this Makefile to your project, keep
#       it together with your source code.  You may use it by simply
#       typing "make" on the command line.  Doing so will cause a new
#       version of your executable program to be produced.
#       While make is doing this, you will see on your screen a list
#	of the compilations that make is performing.
#
###########################################################################

# Specify the compiler you wish to use here.  Please specify either gcc or g++.

CC = g++
#CC = ${PURIFY} g++
PURIFY = purify -max-threads=32 -windows=yes

# Specify any command line flags you wish to pass to the compiler
# here.  You need not specify any flags

CFLAGS = -g 

# Specify the object (".o") files that will hold your compiled file system
# code.  "blockio.o" should be included, as well as any other object
# files corresponding to your file system source code files.  You may
# specify one file or many.  Do NOT include supplementary test files
# such as "bfsinterface.o" in this list.  If your file system code is in
# the files foo.c and bar.c, your OBJFILES list would look as follows:

OBJFILES =  krigblup.o krigmain.o krigcover.o krigmodel.o krigfit.o krigmin.o alloc.o readmat.o writemat.o matrix.o simplex.o inverse.o eigen.o gauss.o trafo.o unix.o unif.o someobjfn.o choldc.o chi.o gasdev.o  kriglib.o powell.o krigeffect.o  

# krigorder.o cdfmnmc.o cdfmndh.o

# The following block specifies the rules for compiling your test file(s).
# If you are using C++, you must change all occurences of ".c" below
# to ".C"
#
# Typing "make" without any arguments will compile the program "a.out" for you


space:  $(OBJFILES)
	$(CC) $(CFLAGS) $(OBJFILES) -lm -o space

# There should be one rule present for each object file mentioned in the
# OBJFILES variable.  The first line of each rule must contain the name of
# the object file, followed by a colon, followed by a space-separated list
# of the files that the object file is dependent on.  (An object file is
# dependent on file x if a change in file x may require the recompilation of
# the object file.  For example, an object file is always dependent on its
# corresponding .c file and any .h files that the .c file includes.)
# The second line MUST BEGIN WITH A TAB and must specify the command
# necessary to compile the object file.  Here, $(CC) should be used in place
# of the actual compiler name.

# For example, the second rule below says that foo.o is created from
# the files foo.c, blockio.h, and bob.h.   This rule tells the make
# program that if foo.c, blockio.h, or bob.h has changed, then a new
# version of foo.o should be produced by recompiling foo.c

krigmin.o:  krigmin.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigmin.cc
krigeffect.o:  krigeffect.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigeffect.cc
krigmain.o: krigmain.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigmain.cc 
krigmodel.o: krigmodel.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigmodel.cc 
krigcover.o: krigcover.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigcover.cc 
krigblup.o: krigblup.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigblup.cc
krigfit.o:  krigfit.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c krigfit.cc
kriglib.o:  kriglib.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c kriglib.cc
readmat.o:  readmat.cc general.h krig.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c readmat.cc
writemat.o: writemat.cc general.h krig.h  matrix.h alloc.h
	$(CC) $(CFLAGS) -c writemat.cc
alloc.o:    alloc.cc general.h  matrix.h alloc.h
	$(CC) $(CFLAGS) -c alloc.cc
matrix.o:     matrix.cc general.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c matrix.cc
trafo.o:    trafo.c general.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c trafo.c
simplex.o:  simplex.c general.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c simplex.c
powell.o:  powell.c general.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c powell.c
inverse.o:  inverse.c general.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c  inverse.c
eigen.o:    eigen.c general.h      matrix.h alloc.h
	$(CC) $(CFLAGS) -c eigen.c
gauss.o:    gauss.c general.h matrix.h alloc.h
	$(CC) $(CFLAGS) -c gauss.c
unix.o : unix.cc general.h
	$(CC) $(CFLAGS) -c unix.cc
unif.o : unif.c
	$(CC) $(CFLAGS) -c unif.c
someobjfn.o: someobjfn.c 
	$(CC) $(CFLAGS) -c someobjfn.c
#alloctree.o: general.h order.h
#	$(CC) $(CFLAGS) -c alloctree.cc
choldc.o: choldc.c general.h 
	$(CC) $(CFLAGS) -c choldc.c
chi.o : chi.c 
	$(CC) $(CFLAGS) -c chi.c
gasdev.o: gasdev.c
	$(CC) $(CFLAGS) -c gasdev.c
#krigorder.o: krigorder.cc general.h matrix.h alloc.h order.h
# 	$(CC) $(CFLAGS) -c krigorder.cc
#cdfmnmc.o: cdfmnmc.c general.h matrix.h alloc.h
#	$(CC) $(CFLAGS) -c cdfmnmc.c
#cdfmndh.o: cdfmndh.c general.h matrix.h alloc.h
#	$(CC) $(CFLAGS) -c cdfmndh.c
