#/bin/sh
###############################################################
#  $Author: dggoodwin $
#  $Date: 2006/04/28 17:22:24 $
#  $Revision: 1.10 $
#
#  Copyright 2002 California Institute of Technology
#
###############################################################

.SUFFIXES :
.SUFFIXES : .cpp .d .o .h

INCDIR = ../../../build/include/cantera/kernel/transport
INSTALL_TSC = ../../../bin/install_tsc
do_ranlib = @DO_RANLIB@

CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT)

# Transport Object Files
OBJS    = TransportFactory.o MultiTransport.o MixTransport.o MMCollisionInt.o \
          SolidTransport.o DustyGasTransport.o
TRAN_H  =  TransportFactory.h MultiTransport.h MixTransport.h \
           MMCollisionInt.h  SolidTransport.h DustyGasTransport.h \
           TransportBase.h L_matrix.h TransportParams.h

CXX_INCLUDES = -I.. @CXX_INCLUDES@
LIB = @buildlib@/libtransport.a

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

all: $(LIB)
	@(@INSTALL@ -d $(INCDIR))
	@(for lh in $(TRAN_H) ; do \
	  $(INSTALL_TSC) "$${lh}" $(INCDIR) ; \
	done)
%.d:
	g++ -MM $(CXX_INCLUDES) $*.cpp > $*.d

.cpp.o:
	@CXX@ -c $< $(CXX_FLAGS) $(CXX_INCLUDES)

$(LIB): $(OBJS) $(TRAN_H)
	@ARCHIVE@ $(LIB) $(OBJS) > /dev/null
ifeq ($(do_ranlib),1)
	@RANLIB@ $(LIB)
endif

clean:
	@(for lh in $(TRAN_H) ; do \
            th=$(INCDIR)/"$${lh}" ; \
	    if test -f "$${th}" ; then \
	      $(RM) "$${th}"  ; \
              echo "$(RM) $${th}" ; \
            fi \
	  done)
	@(if test -f $(LIB) ; then \
	    $(RM) $(LIB) ; \
            echo "$(RM) $(LIB)" ; \
          fi)
	$(RM) *.o *~  .depends
	(if test -d SunWS_cache ; then \
           $(RM) -rf SunWS_cache ; \
         fi )

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

TAGS: 
	etags *.h *.cpp

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

