曲径通幽论坛

标题: 一些编译技巧 [打印本页]

作者: beyes    时间: 2015-3-8 22:45
标题: 一些编译技巧

(1)一般情况,使用一个简单的命令:

[openwrt@localhost trunk]$ make


(2)在多核处理器系统上为提高速度,可使用(例如用3核处理器):

[openwrt@localhost trunk]$ make –j 3


(3)在后台进行编译,使用空闲的I/O资源和CPU性能,可使用(例如使用双核处理器)

[openwrt@localhost trunk]$ onice -c 3 nice -n 20 make -j 2


(4)编译一个单独的软件包(例如在cups软件包):

[openwrt@localhost trunk]$ make package/cups/compile V=99


(5)如果特殊原因需要分析编译报错信息:

[openwrt@localhost trunk]$ make V=99 2>&1 |tee build.log |grep -i error


说明:将编译的所有输出信息保存在build.log中,将error信息打印在屏幕上。


(6)一个复杂指令的应用

[openwrt@localhost trunk]$ ionice -c 3 nice -n 20 make -j 2 V=99 CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \|tee build.log |egrep -i '(warn|error)'

说明:将编译的所有输出信息保存在build.log中,将error和warning信息打印在屏幕上。编译过程使用双核CPU,占用后台资源。







欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2