####################################################################
# Code: Shells2d
# Author: Eitan Grinspun, Sept 2003
# Makefile credit: P.J.Mann, Sept 22, 1995
#
####################################################################
sources = Matrix.cpp ConstScalar.cpp DerScalar.cpp ConstVector.cpp DerVector.cpp Vector2d.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 -Wshadow -Wfloat-equal

#-------------------------------------------------------------------
# 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) test.o
	$(CCC) $(objects) test.o $(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 Vector2d.h /usr/include/assert.h
ConstScalar.o: /usr/include/math.h /usr/include/architecture/ppc/math.h
ConstScalar.o: Matrix.h Scalar.h Vector.h Vector2d.h /usr/include/assert.h
ConstScalar.o: ConstScalar.h ConstVector.h DerScalar.h DerVector.h
DerScalar.o: /usr/include/math.h /usr/include/architecture/ppc/math.h
DerScalar.o: Matrix.h Scalar.h Vector.h Vector2d.h /usr/include/assert.h
DerScalar.o: ConstScalar.h ConstVector.h DerScalar.h DerVector.h
ConstVector.o: Vector.h Vector2d.h /usr/include/assert.h Scalar.h
ConstVector.o: ConstScalar.h ConstVector.h DerScalar.h DerVector.h Matrix.h
DerVector.o: /usr/include/math.h /usr/include/architecture/ppc/math.h
DerVector.o: Matrix.h Scalar.h Vector.h Vector2d.h /usr/include/assert.h
DerVector.o: ConstScalar.h ConstVector.h DerScalar.h DerVector.h
Vector2d.o: /usr/include/math.h /usr/include/architecture/ppc/math.h
Vector2d.o: /usr/include/stdio.h /usr/include/sys/types.h
Vector2d.o: /usr/include/sys/appleapiopts.h /usr/include/sys/cdefs.h
Vector2d.o: /usr/include/machine/types.h /usr/include/ppc/types.h
Vector2d.o: /usr/include/machine/ansi.h /usr/include/ppc/ansi.h
Vector2d.o: /usr/include/machine/endian.h /usr/include/ppc/endian.h
Vector2d.o: Vector2d.h /usr/include/assert.h
test.o: /usr/include/math.h /usr/include/architecture/ppc/math.h Matrix.h
test.o: Scalar.h Vector.h Vector2d.h /usr/include/assert.h ConstScalar.h
test.o: ConstVector.h DerScalar.h DerVector.h
