Find the answer to your Linux question:
Results 1 to 10 of 10
Hello, i am new to linux..i have an error in makefile...actually i want to compile the usbcore module using "make"...but i didnt get the .ko file....the compilation process of "make" ...
  1. #1
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308

    problem in makefile....

    Hello,
    i am new to linux..i have an error in makefile...actually i want to compile the usbcore module using "make"...but i didnt get the .ko file....the compilation process of "make" is given below...

    sharief@sharief-desktop:~/Desktop/drivers/core$ make
    make -C /lib/modules/2.6.26/build M=/home/sharief/Desktop/drivers/core modules
    make[1]: Entering directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
    Building modules, stage 2.
    MODPOST 0 modules
    make[1]: Leaving directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
    sharief@sharief-desktop:~/Desktop/drivers/core$


    but when i compile the "helloworld" module its working ....its given below

    sharief@sharief-desktop:~/Desktop/a$ make
    make -C /lib/modules/2.6.26/build M=/home/sharief/Desktop/a modules
    make[1]: Entering directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
    CC [M] /home/sharief/Desktop/a/a.o
    Building modules, stage 2.
    MODPOST 1 modules
    CC /home/sharief/Desktop/a/a.mod.o
    LD [M] /home/sharief/Desktop/a/a.ko
    make[1]: Leaving directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'


    what is the problem in the first make file...how to clear that error....i am using Ubuntu 7.10...kernel version 2.6.26
    Thanks in advance...

  2. #2
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308
    This is my makefile:

    usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \
    config.o file.o buffer.o sysfs.o endpoint.o \
    devio.o notify.o generic.o quirks.o

    ifeq ($(CONFIG_PCI),y)
    usbcore-objs += hcd-pci.o
    endif

    ifeq ($(CONFIG_USB_DEVICEFS),y)
    usbcore-objs += inode.o devices.o
    endif

    obj-$(CONFIG_USB) += usbcore.o

    ifeq ($(CONFIG_USB_DEBUG),y)
    EXTRA_CFLAGS += -DDEBUG
    endif

    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
    Thanks in advance...

  3. #3
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308
    can anyone explain what it is?

    CONFIG_PCI
    CONFIG_USB_DEVICEFS
    CONFIG_USB
    CONFIG_USB_DEBUG
    EXTRA_CFLAGS += -DDEBUG


    Explain this please...or tell the link where it is explained clearly..i didnt find any link in the net...somebody help me
    Thanks in advance...

  4. #4
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    If you have a module called module.ko that is generated from two source
    files (called, say, file1.c and file2.c), the correct incantation would be:
    obj-m := module.o
    module-objs := file1.o file2.o

    Check for more details here
    http://lwn.net/images/pdf/LDD3/ch02.pdf

  5. #5
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308
    ya that is am doing..i want to create the usbcore module..for that i am using this below files...i posted my full makefile in the #2...

    usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \
    config.o file.o buffer.o sysfs.o endpoint.o \
    devio.o notify.o generic.o quirks.o


    Kindly help me
    Thanks in advance...

  6. #6
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    Don't u think u should have

    obj-m := usbcore.o // also in ur makefile

    usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \
    config.o file.o buffer.o sysfs.o endpoint.o \
    devio.o notify.o generic.o quirks.o

  7. #7
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308
    sorry....i am new to linux....if i ask any stupid thing forgive me..

    you told that i have to use "obj-m := usbcore.o"

    but i have obj-$(CONFIG_USB) += usbcore.o
    is it different?if i have to put your code "obj-m := usbcore.o" in my makefile means where to put that in my makefile...kindly help me...Thanks for your patience reply
    Thanks in advance...

  8. #8
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    obj-$(CONFIG_USB) += usbcore.o

    I forgot to see that...
    You make file looks correct to me. May be somebody with more knowledge in this could help.

  9. #9
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308
    ysa ok...somebody know this help me what to do.....
    Thanks in advance...

  10. #10
    Linux User
    Join Date
    Aug 2008
    Location
    Trichy,India
    Posts
    308
    Can anyone tell me what is the error in this make :

    sharief@sharief-desktop:~/Desktop/drivers/host$ make
    make -C /lib/modules/2.6.26/build M=/home/sharief/Desktop/drivers/host modules
    make[1]: Entering directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
    CC [M] /home/sharief/Desktop/drivers/host/pci-quirks.o
    CC [M] /home/sharief/Desktop/drivers/host/ehci-hcd.o
    CC [M] /home/sharief/Desktop/drivers/host/isp116x-hcd.o
    CC [M] /home/sharief/Desktop/drivers/host/ohci-hcd.o
    CC [M] /home/sharief/Desktop/drivers/host/uhci-hcd.o
    CC [M] /home/sharief/Desktop/drivers/host/sl811-hcd.o
    CC [M] /home/sharief/Desktop/drivers/host/sl811_cs.o
    CC [M] /home/sharief/Desktop/drivers/host/u132-hcd.o
    /home/sharief/Desktop/drivers/host/u132-hcd.c:250:30: error: ../misc/usb_u132.h: No such file or directory
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘read_roothub_info’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:432: error: implicit declaration of function ‘usb_ftdi_elan_read_pcimem’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘u132_hcd_monitor_work’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:503: error: implicit declaration of function ‘ftdi_elan_gone_away’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘edset_input’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:587: error: implicit declaration of function ‘usb_ftdi_elan_edset_input’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘edset_setup’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:597: error: implicit declaration of function ‘usb_ftdi_elan_edset_setup’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘edset_single’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:607: error: implicit declaration of function ‘usb_ftdi_elan_edset_single’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘edset_output’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:617: error: implicit declaration of function ‘usb_ftdi_elan_edset_output’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘u132_hcd_configure_input_recv’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:957: error: implicit declaration of function ‘usb_ftdi_elan_edset_empty’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘u132_hcd_endp_work_scheduler’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:1378: error: implicit declaration of function ‘usb_ftdi_elan_edset_flush’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘u132_periodic_reinit’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:1545: error: implicit declaration of function ‘usb_ftdi_elan_write_pcimem’
    /home/sharief/Desktop/drivers/host/u132-hcd.c: In function ‘u132_hcd_start’:
    /home/sharief/Desktop/drivers/host/u132-hcd.c:1816: error: dereferencing pointer to incomplete type
    /home/sharief/Desktop/drivers/host/u132-hcd.c:1818: error: dereferencing pointer to incomplete type
    make[2]: *** [/home/sharief/Desktop/drivers/host/u132-hcd.o] Error 1
    make[1]: *** [_module_/home/sharief/Desktop/drivers/host] Error 2
    make[1]: Leaving directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
    make: *** [all] Error 2
    sharief@sharief-desktop:~/Desktop/drivers/host$
    Thanks in advance...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...