Trouble compiling out of tree kernel module in 12.04

Santanu Chatterjee thisissantanu at gmail.com
Tue Oct 23 21:07:44 UTC 2012


Hello Again,

Found the problem. Forgot to include the "M=$(PWD)" part in my
Makefile. I feel so stupid now.

-Santanu


On Wed, Oct 24, 2012 at 1:56 AM, Santanu Chatterjee
<thisissantanu at gmail.com> wrote:
> Hello Everybody,
>
> I was trying to compile a simple hello world kind of kernel module. I
> installed the relevant linux-headers package, linked my
> /lib/modules/$(uname -r)/build to point to the linux-headers
> directory. But when I try to run make, I get the following error:
>
> -------------------
> make -C /lib/modules/3.2.0-32-generic-pae/build modules
> make[1]: Entering directory `/usr/src/linux-headers-3.2.0-32-generic-pae'
> make[2]: *** No rule to make target `arch/x86/tools/relocs.c', needed
> by `arch/x86/tools/relocs'.  Stop.
> make[1]: *** [archscripts] Error 2
> make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-32-generic-pae'
> make: *** [all] Error 2
> --------------------
>
> I am attaching my hello.c and Makefile in case anyone wants to take a look.
>
> Can anyone tell me what am I missing? (I have tried 'make' with sudo
> and without sudo, just in case... but no luck)
>
> Regards,
> Santanu




More information about the ubuntu-users mailing list