View Full Version : [SOLVED] Building the simple module fails. -No rule to make target `−C'. Stop

October 29th, 2011, 08:34 PM
Registered: May 2005
Posts: 7

Building the simple module fails. -No rule to make target `−C'. Stop
Here is my sample Hello world program.


#define MODULE

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********************* ******


make −C /lib/modules/$(shell uname -r)/build M=$(pwd) modules
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.

October 29th, 2011, 11:55 PM
I suggest using a text editor, and not something that transforms a simple hyphen into a Unicode minus sign (http://www.fileformat.info/info/unicode/char/2212/index.htm).

October 30th, 2011, 06:55 PM
Thank you very much for the answer. That's amazing catch. That fixed the problem. But still build was not successful

This is what I see in the build output

make[1]: leaving directory /usr/src/linux-headers.....
Building modules stage 2.
MODPOST 0 modules.

Any suggestion?

October 30th, 2011, 07:07 PM
I have retyped the whole make file again.Some Unicode characters are causing the problem. It works after retyping same thing in gedit. Thank you very much for your support.