SCons教程 (2) SConstruct 文件介绍

SConstruct 文件介绍

注释

在文件内,可以将 # 作为注释的起始,如下图。

# this is SConstruct file
Program('hello') 

构建顺序

文件的构建顺序与 SConstruct 内的顺序无关,只需要在文件内,告诉 SCons 需要做什么,具体运行顺序完全由 SCons 自主执行。且需要知道的是,文件读取完之后,没有语法错误,才会进行构建过程,所以应该不存在构建语法导致的失败问题。

admin@DESKTOP-NQU1HUV C:\Users\admin\Desktop\scons\day2
$ scons
scons: Reading SConscript files ...
Calling Program('hello.c')
Calling Program('goodbye.c')
Finished calling Program()
scons: done reading SConscript files.
scons: Building targets ...
gcc -o goodbye.o -c goodbye.c
gcc -o goodbye.exe goodbye.o
gcc -o hello.o -c hello.c
gcc -o hello.exe hello.o
scons: done building targets.

admin@DESKTOP-NQU1HUV C:\Users\admin\Desktop\scons\day2
$ ls
SConstruct  goodbye.c
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值