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.
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
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.
Re: Unable to make makefiles for maverick
Quote:
Originally Posted by
steeldriver
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.