Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

26.3. scons - a software construction tool

http://www.scons.org/

创建一个hello.c测试文件

		
#include<stdio.h>

main()
{
    printf("Hello World!\n");
}
		
		

创建SConstruct文件(相当于Makefile)

$ cat SConstruct
Program('hello.c')
		

开始编译

$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o hello.o -c hello.c
gcc -o hello hello.o
scons: done building targets.
		

编译后产生的文件,尝试运行hello程序

$ ls
hello  hello.c  hello.o  SConstruct

$ ./hello
Hello World!
		

下面操作想当于 make clean

$ scons -c
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Cleaning targets ...
Removed hello.o
Removed hello
scons: done cleaning targets.

$ ls
hello.c  SConstruct