wilcard extra 'jni' in path?

Aristarhys 02/26/2012. 2 answers, 2.588 views
android android makefile android-ndk android-ndk

I try to use wilcards in with help of this answer
But get and error:

make: No rule to make target jni/jni/abyss_engine.c', needed byobj/local/armeabi/objs-debug/AbyssEngine/jni/abyss_engine.o' - this error means no source file found and it's natural because where no jni subfolder in jni folder

Where comes an extra jni in path and why? My source files just in jni folder without any subfolders, how to fix it?


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := AbyssEngine
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.c)
(abyss_engine.c asset_manager.c jni_bridge.c shader_manager.c input_manager.c works fine)
LOCAL_LDLIBS := -llog -lGLESv2

2 Answers

Aristarhys 02/28/2012.

All thanks to a1 from android-ndk group

LOCAL_SRC_FILES=$(notdir $(wildcard $(LOCAL_PATH)/*.c)) - there is more useful info in his reply

cyrilchampier 07/04/2012
The notdir only remove all directory informations from LOCAL_SRC_FILES, but does not avoid ndk to append jni when building. I only get file "jni/hello.cpp" instead of "jni/../../mydir/hello.cpp" :(

override 06/14/2017.

I use External Tools to complie file, and I met this problem in my project。

I change the Working directory Path and the problem is solved。

step1: Settings -> Tools -> External Tools -> NDK ->my build -> Working directory


my old Working directory path is :$ModuleFileDir$\src\main

I change it to : $ModuleFileDir$\src\main\jni

and It runs very well for me!

Related questions

Hot questions


Popular Tags