128 lines
3.1 KiB
Makefile
128 lines
3.1 KiB
Makefile
#!/bin/sh
|
|
|
|
############################################################################
|
|
#
|
|
# Makefile to compile and link a C++ application to
|
|
# Cantera.
|
|
#
|
|
#############################################################################
|
|
|
|
# addition to suffixes
|
|
.SUFFIXES : .d
|
|
|
|
# the name of the executable program to be created
|
|
PROG_NAME = nacl_equil
|
|
|
|
# the object files to be linked together. List those generated from Fortran
|
|
# and from C/C++ separately
|
|
OBJS = nacl_equil.o
|
|
|
|
# additional flags to be passed to the linker. If your program
|
|
# requires other external libraries, put them here
|
|
LINK_OPTIONS =
|
|
|
|
#############################################################################
|
|
|
|
on_DEBUG_MODE=@CANTERA_DEBUG_MODE@
|
|
|
|
# Check to see whether we are in the msvc++ environment
|
|
os_is_win = @OS_IS_WIN@
|
|
|
|
# Fortran libraries
|
|
ifeq (@build_with_f2c@, 0)
|
|
FORT_LIBS = @FLIBS@
|
|
else
|
|
FORT_LIBS =
|
|
endif
|
|
|
|
# the C++ compiler
|
|
CXX = @CXX@
|
|
#
|
|
# The directory where Cantera include files may be found.
|
|
#
|
|
CANTERA_INCDIR=@ctroot@/build/include/cantera
|
|
|
|
INCLUDE_DIRS = -I$(CANTERA_INCDIR)
|
|
|
|
# C++ compile flags
|
|
CXX_FLAGS = @CXXFLAGS@ $(INCLUDE_DIRS) @CXX_INCLUDES@
|
|
|
|
# Ending C++ linking libraries
|
|
LCXX_END_LIBS = @LCXX_END_LIBS@
|
|
|
|
# the directory where the Cantera libraries are located
|
|
CANTERA_LIBDIR=@buildlib@
|
|
#
|
|
# Setup The Cantera Interface
|
|
#
|
|
CANTERA_LIBS= @LOCAL_LIBS@ -lctcxx
|
|
|
|
CANTERA_LIBDEP = \
|
|
$(CANTERA_LIBDIR)/libequil.a \
|
|
$(CANTERA_LIBDIR)/libVCSnonideal.a \
|
|
$(CANTERA_LIBDIR)/libkinetics.a \
|
|
$(CANTERA_LIBDIR)/libtransport.a \
|
|
$(CANTERA_LIBDIR)/libthermo.a \
|
|
$(CANTERA_LIBDIR)/libctnumerics.a \
|
|
$(CANTERA_LIBDIR)/libctmath.a \
|
|
$(CANTERA_LIBDIR)/libtpx.a \
|
|
$(CANTERA_LIBDIR)/libconverters.a \
|
|
$(CANTERA_LIBDIR)/libctbase.a \
|
|
$(CANTERA_LIBDIR)/libctlapack.a \
|
|
$(CANTERA_LIBDIR)/libctblas.a \
|
|
$(CANTERA_LIBDIR)/libctcxx.a
|
|
|
|
|
|
# flags passed to the C++ compiler/linker for the linking step
|
|
LCXX_FLAGS = @CXXFLAGS@ @LOCAL_LIB_DIRS@
|
|
|
|
# How to compile C++ source files to object files
|
|
.cpp.o:
|
|
@CXX@ $(CXX_FLAGS) -c $<
|
|
|
|
# How to compile the dependency file
|
|
.cpp.d:
|
|
@CXX_DEPENDS@ $(CXX_FLAGS) $*.cpp > $*.d
|
|
|
|
# List of dependency files to be created
|
|
DEPENDS=$(OBJS:.o=.d)
|
|
|
|
# Program Name
|
|
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
|
|
|
all: .depends $(PROGRAM)
|
|
|
|
$(PROGRAM): $(OBJS) $(CANTERA_LIBDEP)
|
|
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
|
$(CANTERA_LIBS) @LIBS@ $(FORT_LIBS) $(LCXX_END_LIBS)
|
|
|
|
# depends target -> forces recalculation of dependencies
|
|
depends:
|
|
$(RM) *.d .depends
|
|
@MAKE@ .depends
|
|
|
|
.depends: $(DEPENDS)
|
|
cat *.d > .depends
|
|
|
|
# Do the test -> For the windows vc++ environment, we have to skip checking on
|
|
# whether the program is uptodate, because we don't utilize make
|
|
# in that environment to build programs.
|
|
test:
|
|
ifeq ($(os_is_win), 1)
|
|
else
|
|
@MAKE@ $(PROGRAM)
|
|
endif
|
|
./runtest
|
|
|
|
clean:
|
|
$(RM) $(OBJS) $(PROGRAM) $(DEPENDS) .depends diff.out out.txt \
|
|
diff_csv.txt diff_out.txt err_out.txt vcs_equilibrate_res.csv
|
|
(if test -d SunWS_cache ; then \
|
|
$(RM) -rf SunWS_cache ; \
|
|
fi )
|
|
|
|
ifeq ($(wildcard .depends), .depends)
|
|
include .depends
|
|
endif
|
|
|
|
|