This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

building a out-of-tree module on Beagle Bone Black

Machine Details :

Linux beaglebone 3.8.13-bone47 armv7l GNU/Linux

Problem Details: 

In a attempt to write out-of-tree modules on beagle bone black(as intree modules require me to compile/flash them again and again ), i have logged in to beagle bone black revc through ssh client, which gives me a command line interface via putty, as in general out-of-tree module development, i have tried to compile module with the following make file

   ifneq ($(KERNELRELEASE),)
# kbuild part of makefile
        obj-m  := module.o

        #module-objs := module.o
else
# normal makefile
        KDIR ?= /lib/modules/$(shell uname -r)/build
        PWD  := $(shell pwd)
default:
        $(MAKE) -C $(KDIR) M=$(PWD) modules

endif


resulting an error 

root@beaglebone:~/lddgeek# make

make -C /lib/modules/3.8.13-bone47/build M=/root/lddgeek modules
make: *** /lib/modules/3.8.13-bone47/build: No such file or directory.  Stop.
make: *** [default] Error 2

but when i parse to the path of KDIR i did not find build folder as we find it in an normal ubuntu installed on x86 

if i have to develop drivers/modules out-of-tree on a Beagle how could i do that?