收藏| 在线留言| 联系我们| 关于我们

欢迎来到三河市燕郊瑞铨通机电有限公司网站!

完善的加工设备,丰富的设计、开发制造,管理经验以质量求生存 以信誉求发展

咨询服务热线:18614069018

其它页banner大图
当前位置:首页 > 新闻中心 > 公司新闻

在内核顶层Makefile中增加软链接铝软连接

发布者:wubaiyi 发布日期:2014-06-10

由于**内核头文件位置的改变,一些原有的驱动所包含的头文件会找不到,为了肢解使用旧有的驱动而不做太大改动,可以增加一个软连接:

cd ../include/asm-arm/

ln -sf ../../arch/arm/mach-lpc32xx/include/mach/ arch

将arch/arm/mach-lpc32xx/include/mach/链接为include/asm-arm/arch,即

include/asm-arm/arch-->arch/arm/mach-lpc32xx/include/mach

这样,原有驱动中#include <mach/xxx.h>就可以使用了铝软连接

可以在编译之前手工建立这个链接,但是,一旦make distclean,这个手工建立的链接就会被清除掉,下次还得继续手工建立。这样很麻烦,为了方便,可以直接修改内核顶层的Makefile文件,增加蓝色部分的语句:

980 # We create the target directory of the symlink if it does

981 # not exist so the test in chack-symlink works and we have a

982 # directory for generated filesas used by some architectures.

983 define create-symlink

984     if [ ! -L include/asm ]; then                            

985             echo '  SYMLINK $@ -> include/asm-$(SRCARCH)';    

986             if [ ! -d include/asm-$(SRCARCH) ]; then          

987                 mkdir -p include/asm-$(SRCARCH);          

988             fi;                                              

989             ln -fsn asm-$(SRCARCH) $@;                        

990     fi

991     if [ ! -L include/asm-arm/arch ]; then

992         cd $(TOPDIR)/include/asm-arm;

993         ln -fs ../../arch/arm/mach-lpc32xx/include/mach  arch;

994         cd $(TOPDIR)/;

995     fi

996 endef


三河市燕郊瑞铨通机电有限公司

咨询服务热线:18614069018

联系号码:18614069018

联系电话:0316-3082468

邮箱地址:guangzongxiao@126.com

公司地址:北京东燕郊开发区马起乏工业区