Hello Johnson,
Your file name is "hello.c"
for compiling that, You should write
obj-m := hello.o
in Makefile.
in your case, you have used "mymod.o" so it is trying to search "mymod.c"
file in PWD but there is no such file thats why it throws the error.
Also, I doubt on KERNEL_DIR path. It should be the path where header files
are present. May be you are write if it works fine [let me know also :) ]
Try using this.
obj-m := hello.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
or you can use the following if you want your module name as "mymod.ko"
obj-m := mymod.o
mymod-objs := hello.o
all:
make -C $(KERNELDIR) M=$(PWD) modules
clean:
make -C $(KERNELDIR) M=$(PWD) clean
Warm Regards,
Gagan Chawla
On Wed, Jan 25, 2012 at 2:59 PM, Johnson Pinto <[email protected]>wrote:
> Hi,
> Am using rowboat version of android. I want to build kernel module
> 'hello.c'
>
> my android kernel is in the path ~/rowboat-android/kernel
> I had extracted arm compiler in the path ~/tools/arm/arm-2008q3
>
> My module and makefile is in the path ~/Desktop/test_kernelmod/
>
> My makefile is:
>
> obj-m := mymod.o
> COMPILER :=/home/johnson/rowboat-android/prebuilt/linux-x86/
> toolchain/arm-eabi-4.4.0/bin/arm-eabi-
> CROSS_COMPILE := $(COMPILER)
> ARCH := arm
> KERNELDIR :=/home/johnson/rowboat-android/kernel
>
> PWD := $(shell pwd)
>
> default:
> make -C $(KERNEL_DIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$
> (COMPILER) modules
>
> clean:
> rm *.o; rm *.ko
>
>
>
> I tried all the options by changing the KERNELDIR, and also the
> COMPILER path but of no use..
> I get the errror as :
> make: *** M=/home/johnson/Desktop/test_kernelmod: No such file or
> directory. Stop.
> make: *** [default] Error 2
>
> Can anyone say how to compile it ? what all changes to be made to
> Makefile ?
>
> Thanks,
> Johnson
>
> --
> unsubscribe: [email protected]
> website: http://groups.google.com/group/android-kernel
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel