如何获得Linux内核编译文件的完整列表? [英] How to get a whole list of compiled files of Linux kernel?

查看:299
本文介绍了如何获得Linux内核编译文件的完整列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事不同的Android项目,并且需要在Source Insight中为不同的内核源代码树设置项目. 内核中有许多未使用的文件,我想找到一种方法来挑选出在内核中编译的所有.c,.h,.S文件.手动选择源文件时,我几乎疯了.

I'm working on different Android projects and need to setup project in Source Insight for different kernel source tree. There are many unused files in kernel, I want to find a method to pick out all .c,.h,.S files that are compiled in kernel. I was nearly crazy when I pick the source files manually.

我写了一个脚本,可以提取与.o文件相对应的文件,但是有些.o文件由多个.c文件编译,这使其变得更加复杂.

I'd wrote a script that can pick up the files corresponding to the .o files, but there are some .o files are compiled by multiple .c files, which make it more complicated.

是否有更简单的方法来知道在编译过程中要处理哪些文件?

Is there an easier way to know what files are handled in the compiling process?

任何信息将不胜感激.

这是我在stackoverflow中的第一个问题,我非常喜欢这里.

It's my first question in stackoverflow, I love here so much.

谢谢.

推荐答案

我总是需要搜索内核源代码,而无需查看powerpc,ia86,sparc,alpha,infiniband等.这样做:

I always need to search the kernel source without looking at powerpc, ia86, sparc, alpha, infiniband, etc. Assuming you can compile the kernel, several ways of doing this:

1)从Makefile.build中调用$ K/scripts/basic/fixdep.c为每个源创建一个.cmd文件,其中包含有关编译选项,编译源/目标和依赖项列表的信息.修改此属性以仅使用源文件或源/依赖项编写一个单独的文件.

1) $K/scripts/basic/fixdep.c is called from Makefile.build to create a .cmd file for each source which contains information about the compile options, compile source/target and dependency list. Modify this to write a separate file with just the source file or source/dependencies.

2)破解$ K/scripts/Makefile.build来记录当前编译的文件.请参阅cmd_as_o_S和rule_cc_o_c区域.

2) Hack $K/scripts/Makefile.build to log the currently compiled file. See the cmd_as_o_S and rule_cc_o_c areas.

选项1最好,但是需要一些编码.选项#2是最简单的方法,但却是真正的破解方法,并且不会选择依赖项.

Option #1 is the best but requires a little coding. Option #2 is easiest but a true hack, and doesn't pick up the dependencies.

这篇关于如何获得Linux内核编译文件的完整列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆