title: Cross compiling a kernel module
body: <p>I'm trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host.</p>
  
  <p>The codesourcery tool chain for ARM is located at: <em>/home/ravi/workspace/hawk/arm-2009q3</em></p>
  
  <p>The kernel source is located at :<em>/home/ravi/workspace/hawk/linux-omapl1</em></p>
  
  <p>My Makefile:</p>
  
  <pre><code>ARCH=arm
  CROSS_COMPILE=arm-none-linux-gnueabi
  obj-m := Hello.o
  KDIR := /home/ravi/workspace/hawk/linux-omapl1
  PWD := $(shell pwd)
  default:
            $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
  clean:
            $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
  </code></pre>
  
  <p>When i run <em>make</em>, the .ko produced is that of my host machine which means the makefile is invoking the native compiler instead of the cross compiler.What am I doing wrong? The cross compiler's binaries are in my path.</p>