编译产生debug以及release版本 autotool工具

来源:互联网 发布:视频编辑专家软件下载 编辑:程序博客网 时间:2024/06/11 01:07

按照下面的步骤可以,对于有autotool工具管理的project可以分别产生debug以及release版本。

~ % tar zxf ~/amhello-1.0.tar.gz
~ % cd amhello-1.0
~/amhello-1.0 % mkdir debug optim && cd debug
~/amhello-1.0/debug % ../configure CFLAGS=’-g -O0’
...
~/amhello-1.0/debug % make
...
~/amhello-1.0/debug % cd ../optim
~/amhello-1.0/optim % ../configure CFLAGS=’-O3 -fomit-frame-pointer’
...
~/amhello-1.0/optim % make
...

 

在网上找了好几天了,终于发现了这种方法。该方法来自于automake手册中的2.2.6 Parallel Build Trees (a.k.a. VPATH Builds)这一章节中。

手册地址:

automake手册地址:http://www.gnu.org/software/automake/manual/automake.pdf

autoconf手册地址:http://www.gnu.org/software/automake/manual/autoconf.pdf