Files
cantera/Makefile.in
2006-11-09 21:01:15 +00:00

339 lines
9.3 KiB
Makefile
Executable File

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@
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@
cvs_tag = @CVSTAG@
branch = -r $(cvs_tag)
RMDIRTREE = /bin/rm -r -f
INSTALL_TSC = bin/install_tsc
PY_EXAMPLES = equilibrium fuel_cells flames reactors misc liquid_vapor \
gasdynamics kinetics surface_chemistry transport
prefix=@prefix@
all: hdr-collect kernel user cxxlib clib fortran python matlab \
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 tools-install finish-install
win-install: hdr-install win-kernel-install data-install python-install \
matlab-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; @MAKE@
utils:
cd tools; @MAKE@
kernel-install:
@INSTALL@ -d @ct_libdir@
rm -fR @ct_libdir@/*
( for ilib in @buildlib@/*.a ; do \
@INSTALL@ -m 644 $${ilib} @ct_libdir@ ; \
done )
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@
$(RMDIRTREE) @ct_libdir@/*
( for ilib in @buildlib@/*.lib ; do \
@INSTALL@ -m 644 $${ilib} @ct_libdir@ ; done )
ifeq ($(use_dll),1)
( for ilib in @buildlib@/*.dll ; do \
@INSTALL@ -m 644 $${ilib} @ct_libdir@ ; done )
( for ilib in @buildlib@/*.exp ; do \
@INSTALL@ -m 644 $${ilib} @ct_libdir@ ; done )
endif
data-install:
@INSTALL@ -d @ct_datadir@
( for iddd in data/inputs/*.xml ; do \
@INSTALL@ -m 644 $${iddd} @ct_datadir@ ; done )
( for iddd in data/inputs/*.cti ; do \
@INSTALL@ -m 644 $${iddd} @ct_datadir@ ; done )
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
@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
@(cd Cantera/cxx/include ; for ihhh in *.h ; do \
../../../$(INSTALL_TSC) $${ihhh} ../../../build/include/cantera ; \
done )
@$(INSTALL_TSC) config.h build/include/cantera
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)
@(for exdir in $(PY_EXAMPLES) ; do \
@INSTALL@ -d @ct_demodir@/python/$${exdir} ; \
(for ihhh in Cantera/python/examples/$${exdir}/*.py ; do \
@INSTALL@ $${ihhh} @ct_demodir@/python/$${exdir} ; \
echo "@INSTALL@ $${ihhh} @ct_demodir@/python/$${exdir}" ; \
done ) ; \
@INSTALL@ Cantera/python/examples/$${exdir}/Makefile @ct_demodir@/python/$${exdir} ; \
done)
@(for ihhh in Cantera/python/examples/flames/*.dat ; do \
@INSTALL@ $${ihhh} @ct_demodir@/python/flames ; \
echo "@INSTALL@ $${ihhh} @ct_demodir@/python/flames" ; \
done )
@INSTALL@ Cantera/python/examples/Makefile @ct_demodir@/python
@INSTALL@ -d @ct_tutdir@/python
@(for ihhh in Cantera/python/tutorial/*.py ; do \
@INSTALL@ $${ihhh} @ct_tutdir@/python ; \
echo "@INSTALL@ $${ihhh} @ct_tutdir@/python" ; \
done )
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)
ifneq ($(build_python),0)
cd Cantera/matlab; @MAKE@
endif
else
@echo 'NOT building the Matlab toolbox'
endif
matlab-install:
ifeq ($(build_matlab),1)
ifneq ($(build_python),0)
cd Cantera/matlab; @MAKE@ install
endif
endif
finish-install:
@INSTALL@ -d @ct_docdir@
@INSTALL@ -d @ct_bindir@
(cd Cantera/cxx/demos; @MAKE@ install)
@INSTALL@ tools/templates/cxx/demo.mak @ct_demodir@/cxx
@INSTALL@ -d @ct_demodir@/f77
( for ihhh in Cantera/fortran/f77demos/*.f ; do \
@INSTALL@ $${ihhh} @ct_demodir@/f77 ; done )
@INSTALL@ tools/templates/f77/demo_ftnlib.cpp @ct_demodir@/f77
( for ihhh in Cantera/fortran/f77demos/*.txt ; do \
@INSTALL@ $${ihhh} @ct_demodir@/f77 ; done )
@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)
$(RMDIRTREE) @prefix@/cantera/demos
$(RMDIRTREE) @prefix@/cantera/data
$(RMDIRTREE) @prefix@/cantera/templates
$(RMDIRTREE) @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
ifneq ($(build_python),0)
@INSTALL@ tools/src/finish_install.py tools/bin
(PYTHONPATH=''; @PYTHON_CMD@ tools/bin/finish_install.py @prefix@ @PYTHON_CMD@)
chmod +x @ct_bindir@/ctnew
ifeq ($(build_python),2)
chmod +x @ct_bindir@/mixmaster
endif
cp -f "@homedir@/setup_cantera" "@ct_bindir@"
endif
else
cd Cantera/fortran/f77demos; sed s'/isentropic/ctlib/g' isentropic.dsp > ctlib.dsp
( for ihhh in Cantera/fortran/f77demos/*.dsp ; do \
@INSTALL@ $${ihhh} @ct_demodir@/f77 ; done )
( for ihhh in @buildbin@/* ; do \
@INSTALL@ $${ihhh} @ct_bindir@ ; done )
endif
example_codes:
(cd examples/cxx; @MAKE@ clean; @MAKE@)
(cd Cantera/cxx/demos; @MAKE@ clean)
(cd Cantera/cxx; @MAKE@)
test: example_codes datafiles
cd test_problems; @MAKE@ clean
cd test_problems; @MAKE@ all
cd test_problems; @MAKE@ test
run-matlab-demo:
cd Cantera/matlab; @MAKE@ run-demo
test-matlab:
cd Cantera/matlab; @MAKE@ test-demo
run-python-demo:
cd Cantera/python; @MAKE@ run-demo
datafiles:
cd data/inputs; @MAKE@
uninstall:
$(RMDIRTREE) @ct_incdir@
$(RMDIRTREE) @ct_libdir@
$(RMDIRTREE) @ct_datadir@
$(RMDIRTREE) @ct_demodir@
$(RMDIRTREE) @ct_docdir@
$(RMDIRTREE) @ct_tutdir@
$(RMDIRTREE) @prefix@/matlab/toolbox/cantera
cd tools; @MAKE@ uninstall
clean:
$(RMDIRTREE) *.*~ @buildlib@/*.* build/include/cantera/config.h
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
ChangeLog: CVS/Entries
tools/bin/cvs2cl.pl --prune
export: ChangeLog
@INSTALL@ -d $(export_dir)
if (test -d $(export_dir)/cantera); then rm -r -f $(export_dir)/cantera; fi
if (test -d $(export_dir)/cantera-$(version)); then rm -r -f $(export_dir)/cantera-$(version); fi
cd $(export_dir); cvs export $(branch) cantera
cd $(export_dir)/cantera; rm -r -f win32
cd $(export_dir); mv cantera cantera-$(version)
export-win: ChangeLog
@INSTALL@ -d $(export_dir)
if (test -d $(export_dir)/cantera); then rm -r -f $(export_dir)/cantera; fi
cd $(export_dir); cvs export $(branch) cantera
cd $(export_dir)/cantera; rm -r -f win32
cd $(export_dir)/cantera; cvs export $(branch) 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)
cf:
@INSTALL@ -d $(export_dir)
if (test -d $(export_dir)/cantera); then rm -r -f $(export_dir)/cantera; fi
cd $(export_dir); cvs export $(branch) cantera
cd $(export_dir)/cantera; rm -r -f win32
(cd $(export_dir); \
rm -f cantera-cf.tar.gz; \
tar cvf cantera-cf.tar cantera/*; \
gzip cantera-cf.tar; scp cantera-cf.tar.gz dggoodwin@cf-shell.sourceforge.net:cantera.tar.gz)
sshcf './runall' &
configure: config/configure.in
(cd config; autoconf)
#info:
# echo '#define CANTERA_ROOT "@prefix@/cantera"' > include/ctdir.h