1 LOCAL_PATH := $(call my-dir) 2 3 # Define BUILD_FOO=1 to rebuild libfoo.so from scratch, then 4 # copy obj/local/armeabi/libfoo.so to jni/libfoo.so 5 # 6 ifneq ($(BUILD_FOO),) 7 8 include $(CLEAR_VARS) 9 LOCAL_MODULE := foo 10 LOCAL_SRC_FILES := foo/foo.c 11 LOCAL_C_INCLUDES := $(LOCAL_PATH)/foo 12 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo 13 include $(BUILD_SHARED_LIBRARY) 14 15 else # not build libfoo.so, trying to use PREBUILT_SHARED_LIBRARY instead. 16 17 # Note: the module is named foo-prebuilt, but the library is libfool.so ! 18 # 19 include $(CLEAR_VARS) 20 LOCAL_MODULE := foo-prebuilt 21 LOCAL_SRC_FILES := libfoo.so 22 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo 23 include $(PREBUILT_SHARED_LIBRARY) 24 25 include $(CLEAR_VARS) 26 LOCAL_MODULE := foo-user 27 LOCAL_SRC_FILES := foo-user.c 28 LOCAL_SHARED_LIBRARIES := foo-prebuilt 29 include $(BUILD_SHARED_LIBRARY) 30 31 endif 32