本人想移植一个IIC设备到Android上,但是在添加HAL层接口模块访问设备时,编译iic.c模块时报错,错误信息如下:
root@ubuntu:/home/pngcui/Android/iTop4412_ICS# mmm -B hardware/libhardware/modules/iic ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.0.3 TARGET_PRODUCT=full TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release BUILD_ID=IML74K ============================================ make: Entering directory `/home/pngcui/Android/iTop4412_ICS' build/core/dynamic_binary.mk:112: warning: overriding commands for target `.so' build/core/dynamic_binary.mk:95: warning: ignoring old commands for target `.so' build/core/shared_library.mk:54: warning: overriding commands for target `.so' build/core/dynamic_binary.mk:112: warning: ignoring old commands for target `.so' make: *** No rule to make target `/iic.c', needed by `out/target/product/generic/obj/SHARED_LIBRARIES/iic.default_intermediates/iic.o'. Stop. make: Leaving directory `/home/pngcui/Android/iTop4412_ICS' root@ubuntu:/home/pngcui/Android/iTop4412_ICS#
Android.mk:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw LOCAL_SRC_FILES := iic.c LOCAL_MODULE := iic.default include $(BUILD_SHARED_LIBRARY)
这是什么原因引起的呢?
在Android.mk中添加一句LOCAL_SHARED_LIBRARIES := liblog libcutils就OK了,随后又报i2c-dev.h找不到,把这个头文件复制到相应路径下就可以了。。