例如,有一个我自己加的驱动,路径为:Drivers/abc/abc.c,通常,我们会在abc目录下的Makefile文件中加类似:obj-$(CONFIG_ABC) += abc.o,这样的编译命令。然后编译内核,会在这里生成abc.o,并且会把这个驱动编译到内核中,启动后,驱动会自动加载,并开始工作。
现在,我要把我的内核Source给别人,但是,我又不想把这里的abc驱动的源码给出去,那么,我该怎么做,才可以让别人在没有abc.c源码的情况下,也可以编译内核,并且可以正常使用这个驱动呢?
我是新手,望大家指点!
------解决方案--------------------
我见过一个样例,是用uudecode的
obj-$(CONFIG_ABC) += abc.o
$abc.o: $abc.uu
@echo "UUDE My Private abc.uu"
@uudecode $abc.uu -o $abc.o
uudecode的用法参考网上资料
------解决方案--------------------
ifeq ($(FILE), $(wildcard $(FILE)))
#do something here
endif
在makefile里判断你的文件是否存在可以吗
------解决方案--------------------
------解决方案--------------------
编译成module之后,其他人再更改kernel,那么之前的module还能顺利的插入新的kernel吗?