常用waf命令

常用waf命令

一、配置及编译:
$ ./waf  configure [option]
$ ./waf

帮助:  $ ./waf --help

配置调试,优化调试:  
$ ./waf -d  <debug level> configure
<debug level>: debug,optimized

改变flag:  $ CXXFLAGS="-O3" ./waf configure
或者: $CXX=g++-3.4 ./waf configure


编译的结果放在目录:build/<debuglevel>/srcpath


二、常见命令
1.开启例子及帮助:
$ ./waf configure --enable-examples --enable-tests

2.运行doxygen生成文档     
$ ./waf --doxygen

3.运行代码分析:
$ ./waf configure --enable-gcov
$ ./waf --lcov-report

4.运行程序
$ ./waf --run "program [args]"

5.使用帮助工具运行waf
$ ./waf --run programname --command-template "... %s ..."
如: $ ./waf --run run-tests --command-template "valgrind %s"

6.使用shell调试
$ ./waf --shell
例: $./waf --shell
 $cd build/debug/examples
 $gdb first



7.清除整个build目录
$ ./waf distclean

8.创建一个发布压缩包,包含源代码目录中的所有文件
$ ./waf dist


9.强制禁止python bindings
$./waf --disable-python configure

10.让build系统使用sudo设置suid bit
$./waf --enable-sudo configure




11.重置waf
$cd  repos/ns-3-allinone
$ ./build.py



你可能感兴趣的:(常用waf命令)