101 lines
2.4 KiB
Bash
101 lines
2.4 KiB
Bash
#!/bin/sh
|
|
|
|
# This Makefile builds a Fortran 77 application that uses Cantera. By
|
|
# default, the main program file is 'demo.f,' which prints out some
|
|
# properties of a reacting gas mixture. It uses the library
|
|
# 'demo_ftnlib.cpp,' which contains Fortran-callable functions that
|
|
# are implemented with C++ calls to Cantera.
|
|
|
|
# To build program 'demo', simply type 'make', or 'make -f <this
|
|
# file>' if this file is named something other than 'Makefile.'
|
|
|
|
# Once you have verified that the demo runs, edit this file to replace
|
|
# object file 'demo.o' with your own object file or files. You may
|
|
# continue to use 'demo_ftnlib' if it serves your needs, or else
|
|
# replace it with a different interface library.
|
|
|
|
|
|
#------------------------ edit this block ---------------------------------
|
|
|
|
# the name of the executable program to be created
|
|
PROG_NAME = demo
|
|
|
|
# the object files to be linked together.
|
|
OBJS = demo.o demo_ftnlib.o
|
|
|
|
# additional flags to be passed to the linker. If your program
|
|
# requires other external libraries, put them here
|
|
LINK_OPTIONS = @LCXX_FLAGS@ @EXTRA_LINK@
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
# You probably don't need to edit anything below.
|
|
|
|
|
|
# the Fortran compiler
|
|
FORT = @F77@
|
|
|
|
# Fortran compile flags
|
|
FORT_FLAGS = @FFLAGS@
|
|
|
|
# Fortran libraries used to link fortran main programs
|
|
# using the CXX linker
|
|
FORT_LIBS = @LCXX_FLIBS@ @FLIBS@
|
|
|
|
# the C++ compiler
|
|
CXX = @CXX@
|
|
|
|
# C++ compile flags
|
|
CXX_FLAGS = @CXXFLAGS@
|
|
|
|
# external libraries
|
|
EXT_LIBS = @LOCAL_LIBS@ -lctcxx
|
|
|
|
# the directory where the Cantera libraries are located
|
|
CANTERA_LIBDIR=@ct_libdir@
|
|
|
|
# the directory where Cantera include files may be found.
|
|
CANTERA_INCDIR=@ct_incroot@
|
|
|
|
# flags passed to the C++ compiler/linker for the linking step
|
|
LCXXFLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @LCXX_FLAGS@
|
|
|
|
# how to compile C++ source files to object files
|
|
.@CXX_EXT@.@OBJ_EXT@:
|
|
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
|
|
|
|
# how to compile Fortran source files to object files
|
|
.@F77_EXT@.@OBJ_EXT@:
|
|
$(FORT) -c $< $(FORT_FLAGS)
|
|
|
|
PROGRAM = $(PROG_NAME)$(EXE_EXT)
|
|
|
|
DEPENDS = $(OBJS:.o=.d)
|
|
|
|
all: $(PROGRAM)
|
|
|
|
$(PROGRAM): $(OBJS)
|
|
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXXFLAGS) $(CANTERA_LIBS) $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
|
|
|
|
%.d:
|
|
g++ -MM $*.cpp > $*.d
|
|
|
|
clean:
|
|
$(RM) $(OBJS) $(PROGRAM)
|
|
|
|
depends: $(DEPENDS)
|
|
cat *.d > .depends
|
|
$(RM) $(DEPENDS)
|
|
|
|
TAGS:
|
|
etags *.h *.cpp
|
|
|
|
ifeq ($(wildcard .depends), .depends)
|
|
include .depends
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|