1LOCAL_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# 6ifneq ($(BUILD_FOO),) 7 8include $(CLEAR_VARS) 9LOCAL_MODULE := foo 10LOCAL_SRC_FILES := foo/foo.c 11LOCAL_C_INCLUDES := $(LOCAL_PATH)/foo 12LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo 13include $(BUILD_SHARED_LIBRARY) 14 15else # 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# 19include $(CLEAR_VARS) 20LOCAL_MODULE := foo-prebuilt 21LOCAL_SRC_FILES := libfoo.so 22LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo 23include $(PREBUILT_SHARED_LIBRARY) 24 25include $(CLEAR_VARS) 26LOCAL_MODULE := foo-user 27LOCAL_SRC_FILES := foo-user.c 28LOCAL_SHARED_LIBRARIES := foo-prebuilt 29include $(BUILD_SHARED_LIBRARY) 30 31endif 32