Chinaunix首页 | 论坛 | 博客
  • 博客访问: 60020
  • 博文数量: 37
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 90
  • 用 户 组: 普通用户
  • 注册时间: 2015-08-21 17:01
文章分类
文章存档

2015年(37)

我的朋友

分类: LINUX

2015-08-21 17:41:57

原文地址:openwrt make 简单说明 作者:sheepbao

make 命令简单说明
只编译某个模块
make package/qos/clean
make package/qos/compile
make package/qos/install

编译固件
make V=99

V=99表示输出详细的debug信息

make world
表示编译所有

make j=2 V=99
如是多核CPU,加j=2 选项理论上能加快编译速度
make -j 2 V=99可加快编译速度(不推荐使用)

跳过无用包
如果您正在构建的一切和构建停止在一个包你不关心,你可以跳过失败的包,使用 IGNORE_ERRORS = 1
IGNORE_ERRORS=1 make

make V=99 | tee compile_v1.0.0.log
混合 tee 命令将编译信息放到compile_v1.0.0.log文件中方便查看。

后台编译
 若你在这个系统内编译OpenWrt的同时还处理其他,可以让闲置的I/O及CPU来在后台编译固件 (双核CPU): 
# ionice -c 3 nice -n 20 make -j 2
 
 一个在Feeds里的软件包大约是这样子的: 
# make package/feeds/packages/ndyndns/compile V=99
 
编译错误
 如果因某种不知道的原因而编译失败,下面有种简单的方法来得知编译到底错在哪里了: 
# make V=99 2>&1 |tee build.log |grep -i error
 
 上述编译命令意为:V99参数,将出错信息保存在build.log,生成输出完整详细的副本(with stdout piped to stderr),只有在屏幕上显示的错误。 
 举例说明: 
# 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)'
 
 The above saves a full verbose copy of the build output (with stdout piped to stderr) in build.log and outputs only warnings and errors while building using only background resources on a dual core CPU.


清理编译
make clean
删除目录的内容 / bin
和 / build_dir
不移除工具链, 它还避免了清洗架构/目标

make dirclean
是删除build-dir和staging-dir tmp 

Distclean

make distclean

删除一切编译或配置和所有下载内容提要和包的来源。

谨慎 :除了一切,这将 消除您的构建配置( < buildroot_dir > / config ) ,你的工具链和所有其他来源。 小心使用!

阅读(621) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~