cantera/Cantera/src/Makefile.in
Dave Goodwin dfb0908248 -
2003-12-15 08:54:45 +00:00

164 lines
3.5 KiB
Makefile
Executable file

#/bin/sh
###############################################################
# $Author$
# $Date$
# $Revision$
#
# Copyright 2001 California Institute of Technology
#
###############################################################
SUFFIXES=
SUFFIXES= .cpp .d .o
OBJDIR = .
CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT)
EXT = ../../ext
#----------------------
# kernel components
#----------------------
# basic components always needed
BASE = State.o Elements.o Constituents.o stringUtils.o misc.o importCTML.o plots.o \
xml.o Phase.o DenseMatrix.o ctml.o funcs.o ctvector.o phasereport.o ct2ctml.o
# thermodynamic properties
THERMO = $(BASE) ThermoPhase.o IdealGasPhase.o ConstDensityThermo.o SolidCompound.o SpeciesThermoFactory.o ThermoFactory.o
# homogeneous kinetics
KINETICS = GRI_30_Kinetics.o KineticsFactory.o GasKinetics.o FalloffFactory.o \
ReactionStoichMgr.o $(THERMO)
# heterogeneous kinetics
HETEROKIN = InterfaceKinetics.o ImplicitSurfChem.o SurfPhase.o $(THERMO)
# support for importing from Chemkin-compatible reaction mechanisms
CK = $(KINETICS)
# chemical equilibrium
EQUIL = ChemEquil.o sort.o $(THERMO)
# reaction path analysis
RPATH = Group.o ReactionPath.o
# solvers
SOLVERS = CVode.o BandMatrix.o
# 1D flow models
FLOW1D = $(KINETICS) $(SOLVERS)
EVERYTHING = $(KINETICS) $(HETEROKIN) $(ELECTROCHEM) $(EQUIL) $(CK) \
$(TRANSPORT) $(REACTOR) $(RPATH) $(SOLVERS) $(FLOW1D)
PCH = ct_defs.h.gch utilities.h.gch ThermoPhase.h.gch
all: config.h $(PCH) @KERNEL@ lib
config.h: ../../config.h
cp -f ../../config.h ./config.h
%.h.gch:
ifeq (@precompile_headers@,yes)
@CXX@ $*.h $(CXX_FLAGS)
else
@echo 'skipping precompiling header file $*.h'
endif
base: $(BASE)
thermo: $(THERMO)
kinetics: $(KINETICS) $(HETEROKIN)
ck:
cd converters; @MAKE@
equil: $(EQUIL)
flow1d: $(FLOW1D)
trprops:
cd transport; @MAKE@
reactor:
cd zeroD; @MAKE@
rpath: $(RPATH)
solvers: $(SOLVERS)
tpx:
cd $(EXT)/tpx; @MAKE@
flow1D:
cd oneD; @MAKE@
CXX_LIBS = @LIBS@
CXX_INCLUDES = -I.
CANTERA_LIB = @buildlib@/libcantera.a
DEPENDS = $(EVERYTHING:.o=.d)
%.d:
g++ -MM $*.cpp > $*.d
.cpp.o:
@CXX@ -c $< $(CXX_FLAGS)
#$(CXX_INCLUDES)
# these depend on Makefile to insure that they get rebuilt whenever
# 'configure' has been run since they were last compiled
#misc.o: misc.cpp Makefile
# echo '#define CANTERA_ROOT "@prefix@/cantera"' > ctdir.h
# @CXX@ -c misc.cpp $(CXX_FLAGS)
#ct2ctml.o: ct2ctml.cpp Makefile
# echo '#define PYTHON_EXE "@PYTHON_CMD@"' > pypath.h
# @CXX@ -c ct2ctml.cpp $(CXX_FLAGS)
.f.o:
@F77@ -c $< $(F77_FLAGS)
#
# HKM note: The lib function below removes the library first.
# I was having trouble linking applications on linux
# without removing the cantera library first.
# suggest the following change:
#
# lib:
# @(if [ `ls -1t $(CANTERA_LIB) *.o | head -1` != $(CANTERA_LIB) ] ; then \
# $(RM) $(CANTERA_LIB) ; echo 'ar ruv ' $(CANTERA_LIB) '*.o' ; \
# ar ruv $(CANTERA_LIB) *.o ; fi)
#
lib:
$(RM) $(CANTERA_LIB)
@ARCHIVE@ $(CANTERA_LIB) *.o > /dev/null
cd ../.. ; @MAKE@ hdr-collect
clean:
$(RM) *.o *~ $(CANTERA_LIB)
cd zeroD; @MAKE@ clean
cd oneD; @MAKE@ clean
cd converters; @MAKE@ clean
cd transport; @MAKE@ clean
depends: $(DEPENDS)
cat *.d > .depends
$(RM) $(DEPENDS)
cd oneD; @MAKE@ depends
cd zeroD; @MAKE@ depends
cd converters; @MAKE@ depends
cd transport; @MAKE@ depends
TAGS:
etags *.h *.cpp
ifeq ($(wildcard .depends), .depends)
include .depends
endif