I\'m compiling native sources and adding the dependencies with .a libs and those relative header files with the following structure.
/jni/
And
From the Docs in NDK 5, the solution is to create a local variable..
my-dir Returns the path of the last included Makefile, which typically is the current Android.mk's directory. This is useful to define LOCAL_PATH at the start of your Android.mk as with:
LOCAL_PATH := $(call my-dir)
IMPORTANT NOTE: Due to the way GNU Make works, this really returns
the path of the *last* *included* *Makefile* during the parsing of
build scripts. Do not call my-dir after including another file.
So.. to solve this problem I change my Android.mk to the following.
LOCAL_PATH := $(call my-dir)
MY_PATH := $(LOCAL_PATH)
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
LOCAL_PATH := $(MY_PATH)
LOCAL_LDLIBS := -llog -ldl
LOCAL_MODULE := rmsdk
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
And its works.
I think it is true to def local path after including sub makefiles.
LOCAL_PATH := $(call my-dir)
MY_PATH := $(LOCAL_PATH)
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
LOCAL_PATH := $(MY_PATH)
LOCAL_LDLIBS := -llog -ldl
LOCAL_MODULE := rmsdk
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
It looks wrong. I think you can just try this:
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
LOCAL_PATH := $(call my-dir)
LOCAL_LDLIBS := -llog -ldl
LOCAL_MODULE := rmsdk
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
Hope it helps.