I am trying to write kernel modules. And am running Ubuntu 10.04 x64. I have downloaded both kernel source and headers. Unpacked kernel source and made a /usr/src/linux symbolic link pointing to the src.

I am taking both the module and the Makefile from Linux Kernel Module Programming Guide book. I don't know what am missing. So any help would be appreciated.

Thanks in advance.

paulsm4

06-07-2010 02:19 PM

Hi -

Code:

Makefile:

make -C /lib/modules/$(shell uname -r)/build M=$(pwd) modules

Code:

Actual output:

make -C /lib/modules/2.6.32-22-generic/build M= modules

It looks like your "pwd" command isn't working.

Did you alias it to something in your user environment?

'Hope that helps .. PSM

NightHorse

06-08-2010 03:18 AM

Thanks a lot for identifying my problem... I changed the $(pwd) to either $(PWD) or $(shell pwd) and both works.. Seems I have to use $(shell command) syntax to run a command in Makefiles or it consider it a variable. I thought it's like shell scripts.

Now it all works, Thanks again. :-)

ktnamus

12-05-2012 09:18 PM

same problem with same make file

i tried both $(PWD) & $(shell pwd). it does not work.and it is not including SYMLINK as SYMLINK include/asm -> include/asm-x86