I tried to compile my first loadable kernel module and failed :(
Here is the error:
r@ubuntu:/$ sudo make -C /lib/modules/`uname -r`/build/ M=`pwd` [sudo] password for r: make: Entering directory `/usr/src/linux-headers-2.6.38-8-generic' scripts/Makefile.build:76: kbuild: Makefile.build is included improperly make: *** No rule to make target `kernel/bounds.c', needed by `kernel/bounds.s'. Stop. make: *** [_module_] Error 2 make: Leaving directory `/usr/src/linux-headers-2.6.38-8-generic'
I need help knowing what is wrong.
Here is the makefile i am using:
obj-m += sample_module_for_techblog.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 clean-files := Module.symvers
i found out the following piece of code (which is printing the piece of error that i ma getting) from here
ifndef obj $(warning kbuild: Makefile.build is included improperly) endif
i hope this helps solve the issue.