shell+makefle提取kernel和uboot等编译部分的代码

该脚本`collect-src`通过生成Makefile来搜集编译过的源文件和头文件,适用于内核、busybox、u-boot等项目。首先编译项目,然后运行脚本生成源文件列表,最后用source insight导入列表并使用cscope创建代码索引库。
摘要由CSDN通过智能技术生成

之前写过一篇使用 使用scsh编写脚本收集编译的代码(http://blog.csdn.net/joans123/article/details/7475046), 之所以再写这边文章是因为scsh不常见,以及之前那种方法的扩张性不行. 由于代码编译有Makefile管理的,所以用Makefile来搜集所编译的代码是相当方便及容易扩张的.

下面的collect-src脚本先生成一个Makefile,然后通过运行makefile来搜集编译过的源文件列表并保存到一个文件,最后通过cscope生成代码索引数据库. 具体使用步骤:

1. 编译内核代码(或者是busybox,uboot等): make uImage

2. 运行脚本: ./collect-src -f     (-f 选项的作用是生成列表文件为绝对路径,source insight识别使用)

3. 用source insight导入源文件列表( src.list )


#!/bin/sh
###############################################################################
# File : collect-src
# Description: script to find all the compiled source file and header file
#
#       You must first compile the source and generate *.o files.
#
#       For kernel and busybox , the *.o.cmd file will be generated to find the header file.
#       For u-boot, the .depend file will be generated to find the header file.
#       Others, please concate with me for support!
#
###############################################################################
#
# Usage:
#
#     collect-src [-i list_file ]
#
#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值