Results 1 to 4 of 4

Thread: Unable to make makefiles for maverick

  1. #1
    Join Date
    Sep 2012
    Beans
    2

    Unable to make makefiles for maverick

    i am new to Ubuntu. i have been trying to port to linux but the region from which i come is still relatively new to computers and hence adheres to windows OSes. i have intermediate level knowledge of the c programming language. i have been trying to develop a driver for an USB device and i am stuck at making makefiles in maverick. my .c file is this:
    Code:
    #include<linux/module.h>
    #include<linux/kernel.h>
    #include<linux/usb.h>
    static int usb_notify_subscriber(struct notifier_block *self,unsigned long action,void *dev)
    {
         printk(KERN_INFO "usb_notify_subscriber\n");
         switch(action)
         {
               case USB_DEVICE_ADD: printk(KERN_INFO"usb_notify_subscriber:USB     device added\n");break;
               case USB_DEVICE_REMOVE: printk(KERN_INFO"usb_notify_subscriber:USB device removed\n");break;
               case USB_BUS_ADD: printk(KERN_INFO"usb_notify_subscriber:USB bus added\n");break;
               case USB_BUS_REMOVE: printk(KERN_INFO"usb_notify_subscriber:USB bus removed\n");
         }
         return NOTIFY_OK;
    }
    int init_module(void)
    {
         printk(KERN_INFO"Init USB simple subscriber.\n");
         usb_register_notify(&usb_simple_nb);
         return 0;
    }
    void cleanup_module(void)
    {
         usb_unregister_notify(&usb_simple_nb);
         printk(KERN_INFO"remove USB simple subscriber\n");
    }
    MODULE_LICENSE("GPL");
    and my makefile is this:
    Code:
    obj-m+=simple_usb_subscriber.o
    all:
          make -C/lib/modules/$(shell uname -r)/build M=$(PWD)modules
    clean:
          make -C/lib/modules/$(shell uname -r)/build M=$(PWD)clean
    while trying to run the makefile i get the error message :
    make: nothing to be done for 'all'.

    please help.

  2. #2
    Join Date
    Apr 2012
    Beans
    5,574

    Re: Unable to make makefiles for maverick

    Hi, that sounds like a classic case of using spaces instead of a tab to indent the make command

    Code:
    obj-m+=simple_usb_subscriber.o
    all:
    --->make -C/lib/modules/$(shell uname -r)/build M=$(PWD)modules
    clean:
    --->make -C/lib/modules/$(shell uname -r)/build M=$(PWD)clean
    ---> must be tabs

  3. #3
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Unable to make makefiles for maverick

    FYI, support for Maverick 10.10 ended in April 2012. We are now using kernel version 3.2.24, in the latest release, so you may want to upgrade to 12.04.1 if you want to release your driver for general use.

  4. #4
    Join Date
    Sep 2012
    Beans
    2

    Re: Unable to make makefiles for maverick

    Quote Originally Posted by steeldriver View Post
    Hi, that sounds like a classic case of using spaces instead of a tab to indent the make command

    Code:
    obj-m+=simple_usb_subscriber.o
    all:
    --->make -C/lib/modules/$(shell uname -r)/build M=$(PWD)modules
    clean:
    --->make -C/lib/modules/$(shell uname -r)/build M=$(PWD)clean
    ---> must be tabs
    thanks a lot. its working.

Tags for this Thread

Bookmarks

Posting Permissions

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