Hey all, 

I am working on trying to add custom kernel modules to my AOSP build. 
Currently I have a personal git repo in the AOSP/external/ 
<personal_repo> directory. If I build my kernel module in its 
directory and then build AOSP from the AOSP/ directory, my module is 
loaded successfully into /system/lib/modules. This is good and exactly 
what I would like to happen. 

My problem is that I would like to be able to not have to build my 
module separately, but instead have it automatically built each time I 
build from the AOSP/ directory. Does this sound like a feasible task? 

Here is the Makefile that is in the same directory as my kernel module 
source: 
-----------------------Makefile---------------------------------- 
CROSS_COMPILE ?=$(COMPILER) 
ARCH ?=arm 
PWD := $(shell pwd) 
obj-m:= helloworld.o 

default: 
        $(MAKE) -C $(KERNELDIR) M=`pwd` ARCH=$(ARCH) CROSS_COMPILE=$ 
(COMPILER) modules 
clean: 
        $(MAKE) -C $(KERNELDIR) M=`pwd` ARCH=$(ARCH) CROSS_COMPILE=$ 
(COMPILER) clean 
        @for f in a $(VAR) $(OBJ) modules.order 
../modules_out/helloworld.ko; 
do \ 
        if [ -f $$f ]; then \ 
        rm "$$f"; \ 
        echo "rm $$f" ; \ 
        fi; done 
-----------------------Makefile---------------------------------- 

Here is the Android.mk file that is in the same directory as my kernel 
module source: 
-----------------------Android.mk---------------------------------- 
LOCAL_PATH := $(call my-dir) 
include $(CLEAR_VARS) 

LOCAL_MODULE_TAGS := eng 
LOCAL_MODULE := helloworld.ko 
#LOCAL_MODULE_CLASS := SHARED_LIBRARY 
LOCAL_MODULE_CLASS := SHARED_LIBRARIES 
# This will copy the file in /system/lib/modules 
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/modules 
LOCAL_SRC_FILES := $(LOCAL_MODULE) 

include $(BUILD_PREBUILT) 
-----------------------Android.mk---------------------------------- 

As I mentioned, if I build my module on its own and then build AOSP, 
it works as desired. I would like to not have to build my module 
separately. 

Thanks

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to