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