Error while compiling hello module using make

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello guys ,
 
           I have just started on a project for writing a driver for an ethernet card .i have started following the book Linux device driver by Rubini, 3rd  edition . I got the program samples from their website .  I tried using make command ,got the following error  :


//
 make -C /lib/modules/2.6.10-1.771_FC2/build M=/home/abhi/programming/devicedriver/chap1 modules
make[1]: Entering directory `/lib/modules/2.6.10-1.771_FC2/build'
  CC [M]  /home/abhi/programming/devicedriver/chap1/hello.o
make[2]: *** No rule to make target `/home/abhi/programming/devicedriver/chap1/hellop.c', needed by `/home/abhi/programming/devicedriver/chap1/hellop.o'.  Stop.make[1]: *** [_module_/home/abhi/programming/devicedriver/chap1] Error 2
make[1]: Leaving directory `/lib/modules/2.6.10-1.771_FC2/build'
make: *** [modules] Error 2
[root@localhost chap1]# ls
hello.c  hello.o  Makefile
//

Im running fedora core 2  with linux version in /usr/src/linux2.6.5.x
I have recently installed 2.6.10 kernel version using yum ,which has a different boot loader and is present in the following location:
/lib/modules/2.6.10-1.771_FC2/   ....

 my make file is as follows :
-----------------------------------------------
# To build modules outside of the kernel tree, we run "make"
# in the kernel source tree; the Makefile these then includes this
# Makefile once again.
# This conditional selects whether we are being included from the
# kernel Makefile or not.
ifeq ($(KERNELRELEASE),)
 
    # Assume the source tree is where the running kernel was built
    # You should set KERNELDIR in the environment if it's elsewhere
    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
 
clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
 
.PHONY: modules modules_install clean
 
else
    # called from kernel build system: just declare what our modules are
    obj-m := hello.o hellop.o seq.o jit.o jiq.o sleepy.o complete.o \
             silly.o faulty.o kdatasize.o kdataalign.o
endif
 
------------------------------------------------------------------------------------------------------------
I believe we should get a .ko file as output apart from .o file ....
Any info on where I could have gone wrong will be great..
Hoping for a positive reply

Regards
abhishek


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux