Android.mk wilcard extra 'jni' on the go?

I am trying to use wilcards in Android.mk with this answer https://stackoverflow.com/a/4169181
But get an error:

make: there is no rule for creating a target jni/jni/abyss_engine.c', needed by obj / local / armeabi / objs-debug / AbyssEngine / jni / abyss_engine.o' - this error means that the source file was not found, and this is natural because where there is no jni subfolder in the jni folder

Where does extra jni go along the way and why? My source files are only in the jni folder without any subfolders, how to fix it?

My Android.mk

LOCAL_PATH: = $ (call my-dir)
enable $ (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
LOCAL_CFLAGS: = -Werror
enable $ (BUILD_SHARED_LIBRARY)

+4
source share
2 answers

All thanks to a1 from the android-ndk group

 LOCAL_SRC_FILES=$(notdir $(wildcard $(LOCAL_PATH)/*.c)) 

http://groups.google.com/group/android-ndk/browse_thread/thread/9d4251e0900a31e6/4b792fc207e454c2#4b792fc207e454c2 - there is more useful information in his answer

+4
source

I use external tools for the complie file, and I met this problem in my project.

I am changing the Path working directory and the problem is resolved.

step1: Settings → Tools → External Tools → NDK → my build → Working Directory

step2:

my old working directory path: $ModuleFileDir$\src\main

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

and it works very well for me!

0
source

Source: https://habr.com/ru/post/1398493/


All Articles