4 Star 6 Fork 1

NeoHermit / dao

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bundle.dao 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
NeoHermit 提交于 2015-10-21 12:44 . Fix: a minor bug in the inferencer;
# Building system for single executable deployment:
#
# Given example.dao, the following will compile it into bytecodes,
# and bundle the bytecodes with Dao runtime and loaded modules
# into a single executable:
#
# make -f Makefile.daomake macosx OPTIONS="--option-BUNDLE-SCRIPT example"
daovm_bundle = DaoMake::Option( "BUNDLE", "" )
if( daovm_bundle == "" ) return;
bundler = DaoMake::Project( "DaoBundler" )
bundle_main = bundler.AddObjects( { "kernel/daoMain.c" } )
bundle_script = bundler.AddObjects( { std.path( $working ) / (daovm_bundle + ".dar.c") } )
bundle_main.AddDefinition( "DAO_WITH_STATIC_MODULES" )
bundle_script.AddIncludePath( "kernel" )
bundle = bundler.AddExecutable( daovm_bundle, bundle_main, bundle_script )
finders = DaoMake::ReadFile( daovm_bundle + ".dar.finders" )
bundle_finders = finders.split( "\n" )
# The path variable $(CMD_DIR) in the ".finders" file refers to the building directory,
# which is the working directory for Dao to compile the program. And this script
# should also be executed in the same directory.
cmd_dir = std.path( $working )
dao_dir = DaoMake::GetEnv( "DAO_DIR" )
home_dir = DaoMake::GetEnv( "HOME" )
for( finder in bundle_finders ){
finder = finder.replace( "$(CMD_DIR)/", cmd_dir )
finder = finder.replace( "$(DAO_DIR)/", dao_dir )
finder = finder.replace( "$(HOME)/", home_dir )
fields = finder.split( "\t" )
if( fields.size() < 3 ) skip;
if( DaoMake::IsFile( fields[1] ) ) std.load( fields[1] )
pro = DaoMake::FindPackage( fields[0] )
io.writeln( ">>>>> bundle:", pro, fields )
if( pro != none ) bundle.UseStaticLibrary( pro )
}
# Linking to static library needs to be placed after the objects/libraries
# with unresolved symbols in Linux:
std.load( "FindDao.dao" )
daovm = DaoMake::FindPackage( "Dao" )
if( daovm != none ){
bundle.UseStaticLibrary( daovm, "dao" )
bundle.UseStaticLibrary( daovm, "dao_aux" )
}
C
1
https://gitee.com/neohermit/dao.git
git@gitee.com:neohermit/dao.git
neohermit
dao
dao
master

搜索帮助