Building i2c-tools on android

android-build

I'm trying to integrate i2-tools on Android build system. I have modified the Android.mk as referred from the blog on internet but I could not see my files getting compiled.

LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionalLOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/includeLOCAL_SRC_FILES := tools/i2cbusses.c tools/util.cLOCAL_MODULE := i2c-toolsinclude $(BUILD_STATIC_LIBRARY)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionalLOCAL_SRC_FILES:=tools/i2cdetect.cLOCAL_MODULE:=i2cdetectLOCAL_CPPFLAGS += -DANDROIDLOCAL_SHARED_LIBRARIES:=libcLOCAL_STATIC_LIBRARIES := i2c-toolsLOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/includeinclude $(BUILD_EXECUTABLE)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionalLOCAL_SRC_FILES:=tools/i2cget.cLOCAL_MODULE:=i2cgetLOCAL_CPPFLAGS += -DANDROIDLOCAL_SHARED_LIBRARIES:=libcLOCAL_STATIC_LIBRARIES := i2c-toolsLOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/includeinclude $(BUILD_EXECUTABLE)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionalLOCAL_SRC_FILES:=tools/i2cset.cLOCAL_MODULE:=i2csetLOCAL_CPPFLAGS += -DANDROIDLOCAL_SHARED_LIBRARIES:=libcLOCAL_STATIC_LIBRARIES := i2c-toolsLOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/includeinclude $(BUILD_EXECUTABLE)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionalLOCAL_SRC_FILES:=tools/i2cdump.cLOCAL_MODULE:=i2cdumpLOCAL_CPPFLAGS += -DANDROIDLOCAL_SHARED_LIBRARIES:=libcLOCAL_STATIC_LIBRARIES := i2c-toolsLOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/includeinclude $(BUILD_EXECUTABLE)

Any help is appreciated.

Thanks,
Nanda

Best Solution

I had test it on my environment, it can compile i2c-tools, using the following site for reference:
http://boundarydevices.com/i2c-tools-under-android/

The steps to compile are:

1.enter AOSP.

2.$ source build/envsetup.sh

3.$ lunch xxxxx

4.copy i2c-tools-3.1.0 folder to AOSP/tools/external

5.create Android.mk file (content same as your) in i2c-tools-3.1.0

6.enter i2c-tools-3.1.0 folder,then type $mm

7.you will see the i2ctools was builded in out/target/product/xxxx/system/bin/i2cset