LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := module_name
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/file1.c\
$(LOCAL_PATH)/../file2.c
include $(BUILD_SHARED_LIBRARY)
My problem:
Android Studio can't debug file2.c whose path in Android.mk contain ".."
Files without ".." in their paths is debuggable without any problems.
Example:
c:/dirA/dirB/Android.mk
c:/dirA/dirB/file1.c
c:/dirA/file2.c
LOCAL_SRC_FILES := file1.c # no technical problem
LOCAL_SRC_FILES := $(LOCAL_PATH)/file1.c # no technical problem
LOCAL_SRC_FILES := C:\\dirA\\dirB\\file1.c # no technical problem
LOCAL_SRC_FILES := ../file2.c # can compile file, but can't debug file!
LOCAL_SRC_FILES := $(LOCAL_PATH)/../file2.c # can compile file, but can't debug file!
LOCAL_SRC_FILES := C:\\dirA\\dirB\\..\\file2.c # can compile file, but can't debug file!
LOCAL_SRC_FILES := C:\\dirA\\file2.c # no technical problem, but unusable in big project
This is probably because ndk-build uses __ (double underscore) character to express the path for compiled files to ../, but the debugger is not smart enough to reverse this mapping.
The easy workaround is to set
LOCAL_PATH := $(call my-dir)/..
(or whatever path high enough in file system), and tune the Android.mk appropriately.Cheers,Alex