Your ndk-buid includes prebuit static library, which is not supposed to disappear even in clean build. There is some non-standard step that builds libbar.a and copies it to ../../../../lib/
.
If you have strong reasons not to link to libbar.a directly from the place where it's built (…/obj/local/armeabi
), then you have two options: either include $(PREBUILT_STATIC_LIBRARY)
conditionally if its $(LOCAL_SRC_FILES) is present, or if clean is not the target.
Follows a simple outline of the former approach:
include $(CLEAR_VARS)
LOCAL_MODULE = bar
LOCAL_PATH := ../../../../lib
LOCAL_SRC_FILES := libbar.a
ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_SRC_FILES)))
include $(PREBUILT_STATIC_LIBRARY)
endif