45 lines
1.6 KiB
Python
45 lines
1.6 KiB
Python
from buildutils import *
|
|
|
|
Import('env', 'buildTargets', 'installTargets', 'demoTargets')
|
|
|
|
localenv = env.Clone()
|
|
|
|
f90_src = mglob(localenv, 'src', 'f90', 'cpp')
|
|
|
|
artifacts = localenv.Object(f90_src)
|
|
mods = [o for o in artifacts if o.path.endswith('.mod')]
|
|
objs = [o for o in artifacts if not o.path.endswith('.mod')]
|
|
|
|
lib = localenv.Library(target=pjoin('..','..','lib','fct'),
|
|
source=objs)
|
|
buildTargets.extend(lib)
|
|
inst = localenv.Install('$ct_libdir', lib)
|
|
installTargets.extend(inst)
|
|
|
|
installTargets.extend(localenv.Install('$ct_incdir', mods))
|
|
|
|
# Copy the mod files to the include directory
|
|
for mod in mods:
|
|
copy = localenv.Command(target=pjoin('..','..','include','cantera', mod.name),
|
|
source=mod,
|
|
action=Copy('$TARGET', '$SOURCE'))
|
|
localenv.AddPostAction(lib, copy)
|
|
buildTargets.extend(copy)
|
|
|
|
# (subdir, program name, [source extensions])
|
|
demos = [('f77demos', 'ctlib', ['^ctlib.f']),
|
|
('f77demos', 'isentropic', ['^isentropic.f'])]
|
|
|
|
ftn_demo = localenv.Object(pjoin('f77demos','demo_ftnlib.cpp'))
|
|
for subdir, name, extensions in demos:
|
|
prog = localenv.Program(pjoin(subdir, name),
|
|
mglob(localenv, subdir, *extensions) + ftn_demo,
|
|
LIBS=env['cantera_libs']+['fct']+['stdc++'],
|
|
LINK='$F77')
|
|
demoTargets.extend(prog)
|
|
|
|
inst = localenv.Install(pjoin('$ct_demodir', 'f77'),
|
|
mglob(localenv, 'f77demos',
|
|
'csv','txt','cpp','f','^runtest'))
|
|
|
|
installTargets.extend(inst)
|