本文介绍了传播V = S Flage到所有的子makefile文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我曾经使用建使内核模块,我得到这样的日志

When ever I build kernel modules using make, I get this kind of logs

CC[M] module1
CC[M] module2
CC[M] module3
CC[M] module4

即只是编译或链接有关当前正在处理的任何模块的信息。

i.e just compilation or linking info about any module currently being processed.

我需要知道,这实际上命令编译模块源$ C ​​$ C的完整信息,什么是标记在这些命令等使用。例如

I need to know complete information that which commands actually compiles the modules source code, what are the flags used in those command etc. e.g

gcc -Wall abcd.c 

我甚至检查它通过设置 V = S V = 1 - ñ -d ,但不能得到我想要的东西。

I even checked it by setting V=s , V=1, -n and -d but couldn't get what I want.

请告诉我如何让 V = S 通过每一个后续的makefile传播。它可以通过做出口,通过怎么样?

Kindly tell me how to make V=s propagate through each and every subsequent makefiles. It could be done by exporting, by how?

感谢

推荐答案

有两种方法:


  1. 您可以构建模块使V = 1 打印详细消息。

  2. 您还可以通过将做到这一点出口KBUILD_VERBOSE = 1 行到你的Makefile。

  1. You can build modules with "make V=1" to print verbose messages.
  2. You can also do this by putting "export KBUILD_VERBOSE=1" line into your Makefile.

下面是生成文件的例子:

Here is an example of makefile:


TARGET  :=sysfs-sample

export KBUILD_VERBOSE=1

obj-m += $(TARGET).o

$(TARGET)-objs  := main.o

MODULE_DIR  := "$(PWD)"

all:
    CROSS_COMPILE= ARCH=x86 make -C /lib/modules/$(shell uname -r)/build M=$(MODULE_DIR) modules 

clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(MODULE_DIR) clean

这篇关于传播V = S Flage到所有的子makefile文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 04:27