1. Is scons a magic horse?
Scons is an automatic build tool in Linux, similar to cmake.
2. Installation
Wget http://prdownloads.sourceforge.net/scons/scons-2.2.0.tar.gz.
Tar zxvf scons-2.2.0.tar.gz
CD scons-2.2.0
Python setup. py install
Under normal circumstances, scons will be installed under $ {python_install_dir}/bin/
3. Hello WorldProgram
The three files hello. h hello. C main. c hello. h define the function void Hello (); Hello. C to implement this function, which is called in Main. C.
Compile sconstruct, which is used for scons build. The content is as follows:
Program ('hello', ['hello. C', 'main. c'])
Start building
Scons: Reading sconscript files...
Scons: done reading sconscript files.
Scons: building targets...
Gcc-O hello. O-C hello. c
Gcc-O main. O-C main. c
Gcc-O hello. O main. o
Scons: done building targets.
At this time, the binary file has been built, and the scons thief is easy to use.
4. References
More configuration: http://blog.csdn.net/andyelvis/article/details/7055377
RelatedCodeDownload: http://pan.baidu.com/share/link? Consumer id = 239572 & UK = 908463093