25.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
		





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
Linux Python
LINUX These critical programs are missing or too old: compiler python
LINUX These critical programs are missing or too old: compiler python
1265 0
LINUX These critical programs are missing or too old: compiler python
|
Java 关系型数据库 MySQL
12. 成功解决:No Python 3.* installation was detected.
卸载 Python 时报“No Python 3.* installation was detected.”错误。
954 0
|
算法 Java BI
【论文阅读】(2013)A goal-driven approach to the 2D bin packing and variable-sized bin packing problems
【论文阅读】(2013)A goal-driven approach to the 2D bin packing and variable-sized bin packing problems
187 0
【论文阅读】(2013)A goal-driven approach to the 2D bin packing and variable-sized bin packing problems
configure: error: Library requirements (libpcre >= 7.8) not met
configure: error: Library requirements (libpcre >= 7.8) not met
168 0
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `make` in your path; please make sure that you have t
成功解决ERROR: Unable to find the development tool `make` in your path; please make sure that you have t
成功解决ERROR: Unable to find the development tool `make` in your path; please make sure that you have t
|
机器学习/深度学习 并行计算 TensorFlow
成功解决ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in
成功解决ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in
成功解决ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in
安装swig
安装swig
222 0