通用工具
irori的Python项目详细描述
irori-生成工具
版权所有2019 Sileader。
功能
- 配置文件是python脚本
- 后缀规则
- 并发执行
如何使用
pip install irori
编写配置脚本(makefile.py
)。
fromirori.rulesimportSuffixRule,StaticRule,LinkRulefromiroriimportcontextasctxt,runnerfromirori.dependimportDependenciesimportglobtarget='hello.elf'defbuild(_:ctxt.BuildContext):returnLinkRule(command='clang++ -fPIC -o $@ $^',debug='-O0 -g',release='-O2',rules=SuffixRule(cpp=StaticRule('g++ -std=c++11 -c $< -o $@',debug='-O0 -g',release='-O2'),c=StaticRule('gcc -std=c11 -c -O2 $< -o $@',debug='-O0 -g',release='-O2')))defdepend(_:ctxt.BuildContext):returnSuffixRule(cpp=StaticRule('g++ -MMD -c $< -o $@'),c=StaticRule('gcc -MMD -c $< -o $@'))defrecipes():return{'build':build,'depend':depend}defarguments(parser):passdeffind_files(_:ctxt.BuildContext):returnglob.glob('*.c')+glob.glob('*.cpp')runner.start(target,recipes=recipes,finder=find_files,arguments=arguments,dependencies=Dependencies(files=glob.glob('obj/*.d')))
在makefile.py
目录中运行。
irori build
许可证
GNU GPL 3.0版