天嵌 ARM开发社区

 找回密码
 注册
查看: 1812|回复: 1

g急救!关于gpio的驱动的makefile 的编写

[复制链接]
yanghong21240 发表于 2009-12-23 00:17:44 | 显示全部楼层 |阅读模式
本帖最后由 yanghong21240 于 2009-12-23 00:23 编辑

本人需要利用GPIO接口来控制步进电机,gpio的驱动代码根据内核代码liux2.6.30.4 的源代码下的\drivers\char\EmbedSky_gpio.c的代码添加了我需要的管脚的控制。修改的地方如下。
static unsigned long gpio_table [] =
{
        S3C2410_GPB5,  
        S3C2410_GPB6,
        S3C2410_GPB7,
        S3C2410_GPB8,
        S3C2410_GPF3,
        S3C2410_GPG5,
        S3C2410_GPG7,
};
static unsigned int gpio_cfg_table [] =
{
        S3C2410_GPB5_OUTP,
        S3C2410_GPB6_OUTP,
        S3C2410_GPB7_OUTP,
        S3C2410_GPB8_OUTP,
        S3C2410_GPF3_OUTP,
        S3C2410_GPG5_OUTP,
        S3C2410_GPG7_OUTP,
};
但在makefile 的编译时 出错:makfe 的内容是:
ifneq ($(KERNELRELEASE),)
        obj-m :=gpio.o
else
        KERNELDIR ?= /kernel/opt/EmbedSky/linux-2.6.30.4 (/*pc中内核的路径*/)
        PWD := $(shell pwd)
default:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c
endif
编译时出错:
no rule to make target '/home/mmx/gpio.c' ,needed by /home/mmx/gpio.o/ .stop
亚瑟王 发表于 2009-12-24 10:29:10 | 显示全部楼层
推荐直接将驱动添加到内核中编译。
你修改“$(MAKE) -C $(KERNELDIR) M=$(PWD) modules”为“cd $(KERNELDIR) ;make SUBDIR=$(PWD) modules”然后试试。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-6-27 03:41 , Processed in 1.031250 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表