####################################################################
# Code: Shells2d
# Author: Eitan Grinspun, Sept 2003
# Makefile credit: P.J.Mann, Sept 22, 1995
#
####################################################################
sources = Matrix.cpp ConstScalar.cpp DerScalar.cpp DerVector.cpp Vector3d.cpp test.cpp
objects = $(sources:.cpp=.o) # Gnu make feature 
depends = $(sources:.cpp=.d)

libs = 
includes = -I.. # -I$(HOME)/include

####################################################################
# User definable quantities: adjust for different machines
# and flavours of UNIX.

CCC = g++                   # Gnu C++ compiler name
##CCC = CC                     # Cray C++

#-------------------------------------------------------------------
# Flags for the c++ compiler
# -hinline3,vector3,scalar3,task0: optimize, no parallelization here
# -g: produce debugger output (has to use little optimization)
# -DMY_DEBUG: define my debug flag
# report=fisvt: Cray flag giving compiler listings required.
#               fisvt gives vector, tasking, summary, ...

CCFLAGS = -g -O0 -Wall -W

#-------------------------------------------------------------------
# Flags for the linker

LFLAGS = $(libs)

####################################################################
# Implicit rules: GnuMake format.

%.o: %.cpp
	$(CCC) $(CCFLAGS) $(includes) -c $*.cpp

#-------------------------------------------------------------------
# Top level dependency: main executable depends on the object files


#libautodiff.a : ${objects}
#	libtool ${objects} -o $@

adtest: $(objects)
	$(CCC) $(objects) $(LFLAGS) -o $@

#-------------------------------------------------------------------
# The ``include'' files have been included in the ``.cpp'' dependency
# lists.
# These are separate makefiles which must be included here.
# The ``-'' says continue on if the files don't exist.
# The gnu C++ compiler flag "-MMD" will automatically produce
# these dependency files.

-include $(depends)

#-------------------------------------------------------------------
# Utilities
# (Use "make install"for instance)

.DUMMY: ps install clean clobber RCS  depend # these are all dummy targets

depend:
	makedepend ${includes} $(sources)

ps:
	cp $(sources) all.cpp       # concatenate all sources
	mulcol all.cpp              # print in 2-columns
	rm -f all.cpp               # Remove the work file

##install:
##        cp main $(HOME)/bin       # copy executable to my bin directory

clean:
	rm -f $(objects)          # clean out all the objects
	rm -f *~                  # remove emacs backup files

clobber:
	make clean                # clobber all except source in case I
	rm -f $(depends)          # need to re-compile everything
#        rm -f main

RCS:
	ci -l *.cpp                 # Check-in all source with RCS
	ci -l *.h
# DO NOT DELETE

Matrix.o: Matrix.h Scalar.h Vector.h Vector3d.h
ConstScalar.o: /usr/include/math.h /usr/include/features.h
ConstScalar.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
ConstScalar.o: /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h
ConstScalar.o: /usr/include/bits/mathcalls.h Matrix.h Scalar.h Vector.h
ConstScalar.o: Vector3d.h ConstScalar.h DerScalar.h DerVector.h
DerScalar.o: /usr/include/math.h /usr/include/features.h
DerScalar.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
DerScalar.o: /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h
DerScalar.o: /usr/include/bits/mathcalls.h Matrix.h Scalar.h Vector.h
DerScalar.o: Vector3d.h ConstScalar.h DerScalar.h DerVector.h
DerVector.o: /usr/include/math.h /usr/include/features.h
DerVector.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
DerVector.o: /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h
DerVector.o: /usr/include/bits/mathcalls.h Matrix.h Scalar.h Vector.h
DerVector.o: Vector3d.h ConstScalar.h DerScalar.h DerVector.h
Vector3d.o: Vector3d.h
test.o: /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h
test.o: /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h
test.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h Matrix.h
test.o: Scalar.h Vector.h Vector3d.h ConstScalar.h DerScalar.h DerVector.h
