Take the 2-minute tour ×  For work reasons, I need to develop a
LKM for Android platform. I'm not very sure how to cross compile
my AndroidModule.c and what tools to use for that. I guess that
I'll need the source code of Android in order to tell the
compiler to link the libraries from there right? I will also
need to download the ARM compiler for Android. I think with
those three things is enough (LKM Code in C, Android Source
Code, ARM compiler for android). The problem is that I can't
find any tutorial that explains how to compile LKM for Android.
I'll be very pleased to have more info about it.  share|improve
this question add comment  3 Answers  Here's a makefile that I
use to build modules for Android. I'm assuming you have a copy
of the linux source somewhere and that you have built the kernel
for your phone. In your module directory I put a Makefile like
this:      obj-m := mymod.o     COMPILER
?=/pathtoandroid/prebuilt/linux-x86/toolchain/arm-
eabi-4.4.0/bin/arm-eabi-     ARCH ?=arm     KERNELDIR ?= /