简体   繁体   English

如何使用额外的include路径(包括外部头文件,yaml,boost等库文件)构建树外linux模块

[英]How to build an out-of-tree linux module with an additional include path (includes external header files, librairies like yaml, boost…)

I am trying to build an out-of-tree linux kernel that should take into account external headers files comming from pre- compiled and installed custom libraries. 我正在尝试构建树外的Linux内核,该内核应考虑到来自预编译和安装的自定义库的外部头文件。 My linux module will use functions from a shared library via a C-interface. 我的linux模块将通过C接口使用共享库中的函数。 How is it possible to prevent kernel Makefile of the existence of such files? 如何防止内核Makefile存在此类文件?

    obj-m+= hello_module.o
    $(MAKE) -C $(KDIR) M=$(OUTDIR) modules
    #additional include path
    INCLUDES :=\ 
             -I $(PROJECT_ROOT)/deps1
             -I $(PROJECT_ROOT)/deps2
             -I $(PROJECT_ROOT)/deps3

So how can I include this in $(MAKE) line above? 那么如何在上面的$(MAKE)行中包含它呢? Thanks in advance, Rgds sahbi 在此先感谢,Rgds sahbi

You cannot link user space libraries into modules. 您不能将用户空间库链接到模块中。 But you can link multiple files with the following Makefile: 但是您可以使用以下Makefile链接多个文件:

obj-m := combinedmodule.o
combinedmodule-objs := part1.o part2.o


all:
        make -C $(KERNEL_SRC) M=$(PWD) modules

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM