Android makefile call import path variable value

2.2k views Asked by At

In an android makefile I have a following line

$(call import-add-path,/Users/bruno/Dev/cocos2d-x-2.1.5)

Now, I am working with several people and having that line is not very people-friendly. I have tried defining that path in an environment variable but it gets ignored when I add it to the call import-add-path line. I output the variable as a warning and the makefile obviously has the vatiable present:

$(warning $(NMP))    # outputs: jni/Android.mk:29: /Users/bruno/Dev/cocos2d-x-2.1.5
$(call import-add-path,$(NMP))

How can I make this work so that is multiple developers friendly?

Edit: Eclipse on OSX, building a cocos2d-x 2.1.5 TestCpp project, android NDK r10c. The error message I get is actually about the missing ABI and asking me if I have set the NDK_MODULE_PATH variable properly and it happens only on a debug build (perhaps GDB makes a difference?).

1

There are 1 answers

0
Bikush On

In the end this setup worked for me:

LOCAL_PATH := $(call my-dir)   # ./Project/proj.android/jni/ folder

...

IMPORT_PATH := $(LOCAL_PATH)/../../..    # ./ this gets me to where the modules are located

$(call import-add-path, $(IMPORT_PATH))
$(call import-add-path, $(IMPORT_PATH)/cocos2dx/platform/third_party/android/prebuilt)

$(call import-module,cocos2dx)    # ./cocos2dx
$(call import-module, ... etc.

I could not pass environment variables through Eclipse to the ndk-build, but it worked if I called import-add-path with a value relative to $(call my-dir). This should work with multiple developers as well.