Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1227201
  • 博文数量: 479
  • 博客积分: 12240
  • 博客等级: 上将
  • 技术积分: 4999
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-24 17:12
文章分类

全部博文(479)

文章存档

2014年(1)

2013年(1)

2012年(1)

2011年(95)

2010年(177)

2009年(167)

2008年(16)

2007年(21)

分类: LINUX

2009-12-04 12:59:34


由于最新内核头文件位置的改变,一些原有的驱动所包含的头文件会找不到,为了肢解使用旧有的驱动而不做太大改动,可以增加一个软连接:
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 就可以使用了。

可以在编译之前手工建立这个链接,但是,一旦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

这样,在Make的时候就会自动建立这个软连接了。


阅读(1506) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~