Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1043982
  • 博文数量: 277
  • 博客积分: 8313
  • 博客等级: 中将
  • 技术积分: 2976
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-22 11:25
文章分类

全部博文(277)

文章存档

2013年(17)

2012年(66)

2011年(104)

2010年(90)

我的朋友

分类: LINUX

2010-05-05 15:16:19

本文使用的交叉编译工具为arm-none-linux-gnueabi-gcc
其目录在   /pkg/asw/compilers/gnu/codesourcery/arm-2006q3-27/bin
内核树目录在/home/sein/work/router/lct_kernel/kernel
输出文件:hello.ko
 
先export交叉编译工具的位置
export PATH=/pkg/asw/compilers/gnu/codesourcery/arm-2006q3-27/bin:$PATH
 
 
以下是Makefile的内容
*****************************************************************************
ifeq ($(KERNELRELEASE),)
    KERNELDIR ?=/home/sein/work/router/lct_kernel/kernel
    PWD := $(shell pwd)
modules:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules
modules_install:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=./mod modules_install
clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
.PHONY: modules modules_install clean
else
       obj-m := hello.o
endif
 
*****************************************************************************
阅读(1321) | 评论(0) | 转发(0) |
0

上一篇:编译内核模块

下一篇:GCC内联汇编基础

给主人留下些什么吧!~~