317 lines
8.2 KiB
Makefile
Executable file
317 lines
8.2 KiB
Makefile
Executable file
#
|
|
# $RCSfile$
|
|
# $Author$
|
|
# $Date$
|
|
# $Revision$
|
|
#
|
|
########################################################################
|
|
|
|
export_dir = $(HOME)/sfdist
|
|
version = @ctversion@
|
|
ct = $(export_dir)/cantera-$(version)
|
|
build_ck = @BUILD_CK@
|
|
build_clib = @BUILD_CLIB@
|
|
build_python = @BUILD_PYTHON@
|
|
build_f90 = @BUILD_F90@
|
|
build_matlab = @BUILD_MATLAB@
|
|
build_particles = @BUILD_PARTICLES@
|
|
os_is_win = @OS_IS_WIN@
|
|
incl_user_code = @INCL_USER_CODE@
|
|
do_ranlib = @DO_RANLIB@
|
|
compact_install = @COMPACT_INSTALL@
|
|
use_dll = @USE_CLIB_DLL@
|
|
|
|
prefix=@prefix@
|
|
|
|
all: kernel user cxxlib hdr-collect clib fortran python matlab particles \
|
|
utils datafiles
|
|
|
|
# use this target on a Windows machine to build the Python and
|
|
# MATLAB interfaces after building the project in Visual C++
|
|
win: hdr-collect python matlab
|
|
@echo
|
|
@echo Now type \'make win-install\' to install Cantera in @ct_dir@.
|
|
@echo
|
|
|
|
install: hdr-install kernel-install clib-install data-install f90-modules-install \
|
|
python-install \
|
|
matlab-install particles-install tools-install finish-install
|
|
|
|
win-install: hdr-install win-kernel-install data-install python-install \
|
|
matlab-install particles-install finish-install
|
|
@echo
|
|
@echo Cantera has been successfully installed in @ct_dir@.
|
|
@echo
|
|
|
|
demos: example_codes
|
|
|
|
# build the Cantera static libraries
|
|
kernel:
|
|
@INSTALL@ -d @buildlib@
|
|
@INSTALL@ -d @buildbin@
|
|
cd ext; @MAKE@
|
|
cd Cantera/src; @MAKE@
|
|
ifeq ($(do_ranlib),1)
|
|
@RANLIB@ @buildlib@/*.a
|
|
endif
|
|
|
|
# build the user library
|
|
user:
|
|
ifeq ($(incl_user_code),1)
|
|
cd Cantera/user; @MAKE@
|
|
endif
|
|
|
|
clib:
|
|
ifeq ($(build_clib),1)
|
|
cd Cantera/clib/src; @MAKE@
|
|
endif
|
|
|
|
fortran:
|
|
ifeq ($(build_f90),1)
|
|
cd Cantera/fortran/src; @MAKE@
|
|
@INSTALL@ Cantera/fortran/src/*.mod build/include/cantera
|
|
else
|
|
@echo skipping building the Fortran 90/95 interface
|
|
endif
|
|
|
|
cxxlib:
|
|
cd Cantera/cxx/src; @MAKE@
|
|
|
|
utils:
|
|
cd tools; @MAKE@
|
|
|
|
kernel-install:
|
|
@INSTALL@ -d @ct_libdir@
|
|
rm -f @ct_libdir@/*
|
|
@INSTALL@ -m 644 @buildlib@/*.a @ct_libdir@
|
|
ifeq ($(do_ranlib),1)
|
|
@RANLIB@ @ct_libdir@/*.a
|
|
endif
|
|
|
|
clib-install:
|
|
ifeq ($(build_clib),1)
|
|
cd Cantera/clib/src; @MAKE@ install
|
|
endif
|
|
|
|
win-kernel-install:
|
|
@INSTALL@ -d @ct_libdir@
|
|
rm -f @ct_libdir@/*
|
|
@INSTALL@ -m 644 @buildlib@/*.lib @ct_libdir@
|
|
ifeq ($(use_dll),1)
|
|
@INSTALL@ -m 644 @buildlib@/*.dll @ct_libdir@
|
|
@INSTALL@ -m 644 @buildlib@/*.exp @ct_libdir@
|
|
endif
|
|
|
|
data-install:
|
|
@INSTALL@ -d @ct_datadir@
|
|
@INSTALL@ -m 644 data/inputs/elements.xml @ct_datadir@
|
|
@INSTALL@ -m 644 data/inputs/gri30.xml @ct_datadir@
|
|
@INSTALL@ -m 644 data/inputs/*.cti @ct_datadir@
|
|
|
|
tools-install:
|
|
cd tools; @MAKE@ install
|
|
|
|
hdr-install:
|
|
@INSTALL@ -d @ct_incdir@
|
|
cp -r -f build/include/cantera @ct_incroot@
|
|
|
|
f90-modules-install:
|
|
ifeq ($(build_f90),1)
|
|
@INSTALL@ -m 644 build/include/cantera/*.mod @ct_incroot@/cantera
|
|
endif
|
|
|
|
# collect scattered header files and build the include directory
|
|
hdr-collect:
|
|
@INSTALL@ -d build/include/cantera
|
|
rm -r -f build/include/cantera/*
|
|
@INSTALL@ -d build/include/cantera/kernel
|
|
@INSTALL@ -d build/include/cantera/kernel/oneD
|
|
@INSTALL@ -d build/include/cantera/kernel/zeroD
|
|
@INSTALL@ -d build/include/cantera/kernel/converters
|
|
@INSTALL@ -d build/include/cantera/kernel/transport
|
|
@INSTALL@ Cantera/cxx/include/*.h build/include/cantera
|
|
@INSTALL@ config.h build/include/cantera
|
|
@INSTALL@ Cantera/src/*.h build/include/cantera/kernel
|
|
@INSTALL@ Cantera/src/oneD/*.h build/include/cantera/kernel/oneD
|
|
@INSTALL@ Cantera/src/zeroD/*.h build/include/cantera/kernel/zeroD
|
|
@INSTALL@ Cantera/src/converters/*.h build/include/cantera/kernel/converters
|
|
@INSTALL@ Cantera/src/transport/*.h build/include/cantera/kernel/transport
|
|
|
|
particles:
|
|
ifeq ($(build_particles),1)
|
|
cd Cantera/cads; @MAKE@
|
|
endif
|
|
|
|
particles-install:
|
|
ifeq ($(build_particles),1)
|
|
cd Cantera/cads; @MAKE@ install
|
|
endif
|
|
|
|
|
|
|
|
python:
|
|
ifeq ($(build_python),2)
|
|
ifeq ($(os_is_win),0)
|
|
cd Cantera/python; @MAKE@
|
|
else
|
|
cd Cantera/python; @MAKE@ win
|
|
endif
|
|
endif
|
|
ifeq ($(build_python),1)
|
|
cd Cantera/python; @MAKE@ minbuild
|
|
endif
|
|
|
|
python-install:
|
|
ifneq ($(build_python),0)
|
|
cd Cantera/python; @MAKE@ install
|
|
ifeq ($(build_python),2)
|
|
@INSTALL@ -d @ct_demodir@/python
|
|
@INSTALL@ Cantera/python/examples/*.py @ct_demodir@/python
|
|
@INSTALL@ -d @ct_tutdir@/python
|
|
@INSTALL@ Cantera/python/tutorial/*.py \
|
|
@ct_tutdir@/python
|
|
chown -R @username@ @ct_demodir@/python
|
|
chown -R @username@ @ct_tutdir@/python
|
|
else
|
|
@echo 'NOT installing Python demos or tutorials'
|
|
endif
|
|
endif
|
|
|
|
matlab:
|
|
ifeq ($(build_matlab),1)
|
|
cd Cantera/matlab; @MAKE@
|
|
else
|
|
@echo 'NOT building the Matlab toolbox'
|
|
endif
|
|
|
|
matlab-install:
|
|
ifeq ($(build_matlab),1)
|
|
cd Cantera/matlab; @MAKE@ install
|
|
@INSTALL@ -d @ct_demodir@/matlab
|
|
@INSTALL@ Cantera/matlab/cantera/examples/*.m @ct_demodir@/matlab
|
|
@INSTALL@ -d @ct_tutdir@/matlab
|
|
@INSTALL@ Cantera/matlab/cantera/tutorial/*.m @ct_tutdir@/matlab
|
|
chown -R @username@ @ct_demodir@/matlab
|
|
chown -R @username@ @ct_tutdir@/matlab
|
|
endif
|
|
|
|
finish-install:
|
|
@INSTALL@ -d @ct_docdir@
|
|
@INSTALL@ -d @ct_bindir@
|
|
|
|
@INSTALL@ -d @ct_demodir@/cxx
|
|
@INSTALL@ Cantera/cxx/demos/*.cpp @ct_demodir@/cxx
|
|
@INSTALL@ Cantera/cxx/demos/*.h @ct_demodir@/cxx
|
|
@INSTALL@ Cantera/cxx/demos/*.csv @ct_demodir@/cxx
|
|
@INSTALL@ Cantera/cxx/demos/*.dat @ct_demodir@/cxx
|
|
@INSTALL@ Cantera/cxx/demos/Makefile.install @ct_demodir@/cxx/Makefile
|
|
chown -R @username@ @ct_demodir@/cxx
|
|
|
|
@INSTALL@ -d @ct_demodir@/f77
|
|
@INSTALL@ Cantera/fortran/f77demos/*.f @ct_demodir@/f77
|
|
@INSTALL@ tools/templates/f77/demo_ftnlib.cpp @ct_demodir@/f77
|
|
@INSTALL@ Cantera/fortran/f77demos/*.txt @ct_demodir@/f77
|
|
@INSTALL@ Cantera/fortran/f77demos/f77demos.mak @ct_demodir@/f77/Makefile
|
|
chown -R @username@ @ct_demodir@/f77
|
|
|
|
ifeq ($(os_is_win),0)
|
|
|
|
# if not a 'compact' installation, then add some symbolic links for convenience.
|
|
ifeq ($(compact_install),0)
|
|
rm -fR @prefix@/cantera/demos
|
|
rm -fR @prefix@/cantera/data
|
|
rm -fR @prefix@/cantera/templates
|
|
rm -fR @prefix@/cantera/tutorials
|
|
ln -s @ct_demodir@ @prefix@/cantera/demos
|
|
ln -s @ct_datadir@ @prefix@/cantera/data
|
|
ln -s @ct_templdir@ @prefix@/cantera/templates
|
|
ln -s @ct_tutdir@ @prefix@/cantera/tutorials
|
|
@INSTALL@ License.* @prefix@/cantera
|
|
endif
|
|
@INSTALL@ tools/src/finish_install.py tools/bin
|
|
(PYTHONPATH=''; @PYTHON_CMD@ tools/bin/finish_install.py @prefix@ @PYTHON_CMD@)
|
|
chmod +x @ct_bindir@/ctnew
|
|
cp -f @homedir@/setup_cantera @ct_bindir@
|
|
else
|
|
cd Cantera/fortran/f77demos; sed s'/isentropic/ctlib/g' isentropic.dsp > ctlib.dsp
|
|
@INSTALL@ Cantera/fortran/f77demos/*.dsp @ct_demodir@/f77
|
|
@INSTALL@ @buildbin@/* @ct_bindir@
|
|
endif
|
|
|
|
example_codes:
|
|
(cd examples/cxx; @MAKE@)
|
|
(cd Cantera/cxx; @MAKE@)
|
|
|
|
test: example_codes datafiles
|
|
cd test_problems; @MAKE@ all
|
|
cd test_problems; @MAKE@ test
|
|
|
|
run-matlab-demo:
|
|
cd Cantera/matlab; @MAKE@ run-demo
|
|
|
|
run-python-demo:
|
|
cd Cantera/python; @MAKE@ run-demo
|
|
|
|
datafiles:
|
|
cd data/inputs; @MAKE@
|
|
|
|
uninstall:
|
|
rm -r -f @ct_incdir@
|
|
rm -r -f @ct_libdir@
|
|
rm -r -f @ct_datadir@
|
|
rm -r -f @ct_demodir@
|
|
rm -r -f @ct_docdir@
|
|
rm -r -f @ct_tutdir@
|
|
rm -r -f @prefix@/matlab/toolbox/cantera
|
|
cd tools; @MAKE@ uninstall
|
|
|
|
clean:
|
|
rm -f *.*~ @buildlib@/*.*
|
|
cd Cantera; @MAKE@ clean
|
|
cd tools; @MAKE@ clean
|
|
cd ext; @MAKE@ clean
|
|
cd test_problems; @MAKE@ clean
|
|
cd examples; @MAKE@ clean
|
|
|
|
docs:
|
|
cd tools/doxygen/Cantera; doxygen Cantera.cfg
|
|
|
|
depends:
|
|
cd Cantera; @MAKE@ depends
|
|
cd tools; @MAKE@ depends
|
|
cd ext; @MAKE@ depends
|
|
ifeq ($(build_particles),1)
|
|
cd Cantera/cads; @MAKE@ depends
|
|
endif
|
|
|
|
changes:
|
|
tools/bin/cvs2cl.pl --prune
|
|
cvs commit -m' ' ChangeLog
|
|
|
|
export: changes
|
|
@INSTALL@ -d $(export_dir)
|
|
if (test -d $(export_dir)/cantera); then rm -r -f $(export_dir)/cantera; fi
|
|
cd $(export_dir); cvs export -D 1/01/2010 cantera
|
|
cd $(export_dir)/cantera; rm -r -f win32
|
|
cd $(export_dir); mv cantera cantera-$(version)
|
|
|
|
export-win: changes
|
|
@INSTALL@ -d $(export_dir)
|
|
if (test -d $(export_dir)/cantera); then rm -r -f $(export_dir)/cantera; fi
|
|
cd $(export_dir); cvs export -D 1/01/2010 cantera
|
|
cd $(export_dir)/cantera; rm -r -f win32
|
|
cd $(export_dir)/cantera; cvs export -D 1/01/2010 win32
|
|
cd $(export_dir); mv cantera cantera-$(version)
|
|
|
|
pack: export
|
|
(cd $(export_dir); \
|
|
rm -f cantera-$(version).tar.gz; \
|
|
tar cvf cantera-$(version).tar cantera-$(version)/*; \
|
|
gzip cantera-$(version).tar)
|
|
|
|
#info:
|
|
# echo '#define CANTERA_ROOT "@prefix@/cantera"' > include/ctdir.h
|
|
|
|
|
|
|
|
|