ksuneel
October 29th, 2011, 08:34 PM
Registered: May 2005
Posts: 7
Rep:
Building the simple module fails. -No rule to make target `−C'. Stop
Here is my sample Hello world program.
****************Hello.c**************
#define MODULE
#include<linux/module.h>
#include<linux/kernel.h>
int init_module(void) {
printk("<1> Hello World \n");
return 0;
}
void cleanup_module(void)
{
printk("<1> Goodbuy World \n");
}
make file for that.
*********************Makefile********************* ******
obj−m:=hello.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
When I do make This is what I see.
make −C /lib/modules/3.0.0-12-generic/build M= modules
make[1]: Entering directory `/home/suneel/Samples'
make[1]: *** No rule to make target `−C'. Stop.
make[1]: Leaving directory `/home/suneel/Samples'
make: *** [all] Error 2
Please suggest some solution.
Posts: 7
Rep:
Building the simple module fails. -No rule to make target `−C'. Stop
Here is my sample Hello world program.
****************Hello.c**************
#define MODULE
#include<linux/module.h>
#include<linux/kernel.h>
int init_module(void) {
printk("<1> Hello World \n");
return 0;
}
void cleanup_module(void)
{
printk("<1> Goodbuy World \n");
}
make file for that.
*********************Makefile********************* ******
obj−m:=hello.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
When I do make This is what I see.
make −C /lib/modules/3.0.0-12-generic/build M= modules
make[1]: Entering directory `/home/suneel/Samples'
make[1]: *** No rule to make target `−C'. Stop.
make[1]: Leaving directory `/home/suneel/Samples'
make: *** [all] Error 2
Please suggest some solution.