28 lines
816 B
Python
28 lines
816 B
Python
import os
|
|
Import('env', 'build_type', 'prefix', 'version_info')
|
|
|
|
ucore_env = env.Clone()
|
|
|
|
#substitute @version_xx@ strings
|
|
subst_version_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
|
|
ucore_env.Substfile('ucore_version.c.in', SUBST_DICT = subst_version_info)
|
|
ucore_env.Append(CFLAGS = ['-pthread'])
|
|
|
|
sources = ucore_env.Glob('*.c')
|
|
headers = ucore_env.Glob('*.h')
|
|
|
|
#print 'ucore_env', dir(ucore_env)
|
|
#print ucore_env.Dump()
|
|
#print 'sources:', sources[len(sources)-2]
|
|
|
|
#Build library
|
|
ucore_lib = ucore_env.StaticLibrary(target='ucore_' + build_type , source=sources)
|
|
|
|
#install targets
|
|
ucore_env.Alias('install',
|
|
ucore_env.Install(os.path.join(prefix, 'lib'), ucore_lib))
|
|
|
|
ucore_env.Alias('install',
|
|
ucore_env.InstallPerm(os.path.join(prefix, 'include', 'ucore'), headers, 0644))
|
|
|