#/bin/sh
###############################################################
#  $Author: hkmoffa $
#  $Date: 2006/04/30 22:10:37 $
#  $Revision: 1.5 $
#
#  Copyright 2001 California Institute of Technology
#
###############################################################


SUFFIXES=
SUFFIXES= .cpp .d .o

CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT)

OBJS = cxxutils.o 

DEPENDS = $(OBJS:.o=.d)

# the C++ compiler
CXX = @CXX@

# the directory where Cantera include files may be found.
CANTERA_INCDIR=../../src

CXX_INCLUDES = -I$(CANTERA_INCDIR)  

# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:
	$(CXX) -c $< $(CXX_INCLUDES) $(CXX_FLAGS)

LIB_NAME=libctcxx
CXXLIB=@buildlib@/$(LIB_NAME).a

all: $(CXXLIB)

$(CXXLIB): $(OBJS)
	@ARCHIVE@ $(CXXLIB) $(OBJS) 

clean:
	$(RM) $(OBJS) $(CXXLIB)
	(if test -d SunWS_cache ; then \
           $(RM) -rf SunWS_cache ; \
         fi )

install:
	@INSTALL@ $(CXXLIB) @prefix@/lib/cantera

%.d:
	g++ -MM $(CXX_INCLUDES) $*.cpp > $*.d

depends: $(DEPENDS)
	cat *.d > .depends
	$(RM) $(DEPENDS) 

ifeq ($(wildcard .depends), .depends)
include .depends
endif
