132 lines
3.3 KiB
Makefile
132 lines
3.3 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 = rankine
|
|
|
|
# The object files to be linked together.
|
|
OBJS = rankine.o
|
|
|
|
# additional flags to be passed to the linker. If your program
|
|
# requires other external libraries, put them here
|
|
LINK_OPTIONS = @EXTRA_LINK@
|
|
|
|
# This variable determines whether we are making this example in the
|
|
# build tree environment or in the install tree environment.
|
|
in_CanteraBuildTree = 1
|
|
|
|
#############################################################################
|
|
|
|
# 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.
|
|
ifeq ($(in_CanteraBuildTree),1)
|
|
CANTERA_INCROOTDIR=@ctroot@/build/include
|
|
else
|
|
CANTERA_INCROOTDIR=@ct_incroot@
|
|
endif
|
|
CANTERA_INCLUDES=-I$(CANTERA_INCROOTDIR) -I$(CANTERA_INCROOTDIR)/cantera
|
|
|
|
# LOCAL_DEFS = -DDEBUG_CHEMEQUIL
|
|
# LOCAL_DEFS = -DEBUG_BASISOPTIMIZE
|
|
#
|
|
# C++ compile flags
|
|
CXX_FLAGS = @CXXFLAGS@ $(CANTERA_INCLUDES) $(LOCAL_DEFS) @CXX_INCLUDES@
|
|
|
|
# Ending C++ linking libraries
|
|
LCXX_END_LIBS = @LCXX_END_LIBS@
|
|
|
|
# the directory where the Cantera libraries are located
|
|
ifeq ($(in_CanteraBuildTree),1)
|
|
CANTERA_LIBDIR=@buildlib@
|
|
else
|
|
CANTERA_LIBDIR=@ct_libdir@
|
|
endif
|
|
|
|
# required Cantera libraries
|
|
CANTERA_LIBS = -L$(CANTERA_LIBDIR) @LOCAL_LIBS@ -lctcxx
|
|
|
|
ifeq ($(in_CanteraBuildTree),1)
|
|
CANTERA_LIBS_DEP = @LOCAL_LIBS_DEP@ $(CANTERA_LIBDIR)/libctcxx.a
|
|
else
|
|
CANTERA_LIBS_DEP = @INSTALL_LIBS_DEP@ $(CANTERA_LIBDIR)/libctcxx.a
|
|
endif
|
|
#
|
|
# Alternate form of dependencies: (uses a gnu make extensions)
|
|
ALT_LIBS_DEP := $(addprefix $(CANTER_LIBDIR), @RAW_LIBS_DEP@ 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) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
|
|
|
|
# How to compile the dependency file
|
|
.cpp.d:
|
|
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $*.cpp > $*.d
|
|
|
|
# List of dependency files to be created
|
|
DEPENDS=$(OBJS:.o=.d)
|
|
|
|
# Program Name
|
|
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
|
|
|
all: $(PROGRAM) .depends
|
|
|
|
$(PROGRAM): $(OBJS) $(CANTERA_LIBS_DEP)
|
|
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \
|
|
$(CANTERA_LIBS) @LIBS@ $(FORT_LIBS) \
|
|
$(LCXX_END_LIBS)
|
|
|
|
$(OBJS): Makefile
|
|
|
|
#
|
|
# 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@ -s $(PROGRAM)
|
|
endif
|
|
@ ./runtest
|
|
|
|
clean:
|
|
$(RM) $(OBJS) $(PROGRAM) $(DEPENDS) .depends
|
|
../../bin/rm_cvsignore
|
|
(if test -d SunWS_cache ; then \
|
|
$(RM) -rf SunWS_cache ; \
|
|
fi )
|
|
|
|
ifeq ($(wildcard .depends), .depends)
|
|
include .depends
|
|
endif
|