设备驱动程序使文件错误

时间:2013-12-01 09:11:50

标签: c unix makefile

我编写了以下make文件(基本上是为了编译设备驱动程序),我无法编译我的代码。

这是我的Makefile:

ifeq ($(KERNELRELEASE),)

        KERNELDIR ?= /lib/modules/$(shell uname -r)/build

    # The current directory is passed to sub-makes as argument
        PWD := $(shell pwd)

modules:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

abc: abc.c
    gcc abc.c -o abc -lpthread

clean:
    rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions abc

.PHONY: modules modules_install clean

else
    # called from kernel build system: just declare what our modules are
    obj-m := xyz.o
endif

我收到以下错误:

make -C /lib/modules/3.2.0-53-generic/build M=/home/some/something LDDINC=/home/some/something/../include modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-53-generic'
make[2]: *** No rule to make target `/home/some/something/xyz.c', needed by `/home/some/something/xyz.o'.  Stop.
make[1]: *** [_module_/home/some/something] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-53-generic'
make: *** [modules] Error 2

如果有人能够指出我可能正在做的错误

那会很棒

0 个答案:

没有答案