查看: 16517|回复: 0

[Linux] 模块驱动 写个helloworld程序,调用编译工具路径

6

主题

36

回帖

59

积分

AM335x通行证

踏雪you坑 发表于 2014-12-18 16:49:26 | 显示全部楼层 |阅读模式
ifneq ($(KERNELRELEASE),)

obj-m := hello.o

else

#KDIR := /lib/modules/3.13.0-24-generic/build
KDIR := /usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/
all:
             make -C $(KDIR) M=$(PWD) modules

clean:
        rm -f *.ko *.o *.mod.o *.mod.c *.symvers
endif

以上是makefile的内容,生产hello。ko的模块。
红色的ubuntu的编译链    可以编译的过。。。然而am335xs-Ⅱ的板子不懂KDIR改写什么。
root@ubuntu:/nfs_rootfs/home/program/a# make
make -C /usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/ M=/nfs_rootfs/home/program/a modules
make[1]: Entering directory `/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi'
make: *** [all] Error 2


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则