Android.mk 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 Android.mk with help of this answerhttps://stackoverflow.com/a/8459242/1039175
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?

My Android.mk

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
LOCAL_CFLAGS := -Werror
include $(BUILD_SHARED_LIBRARY)

2 Answers


Aristarhys 02/28/2012.

All thanks to a1 from 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 info in his reply

1 comments
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

step2:

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

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

and It runs very well for me!


HighResolutionMusic.com - Download Hi-Res Songs

1 BLACKPINK

Kiss And Make Up flac

BLACKPINK. 2018. Writer: Soke;Kny Factory;Billboard;Chelcee Grimes;Teddy Park;Marc Vincent;Dua Lipa.
2 Martin Garrix

Waiting For Tomorrow flac

Martin Garrix. 2018. Writer: Pierce Fulton;Mike Shinoda;Martijn Garritsen;Brad Delson.
3 Martin Garrix

Access flac

Martin Garrix. 2018. Writer: Martin Garrix.
4 John Legend

Written In The Stars flac

John Legend. 2018. Writer: Kiana Brown;Santoy;Kevin White;Mike Woods;MZMC;The Heavy Group;Rice N' Peas.
5 Martin Garrix

Yottabyte flac

Martin Garrix. 2018. Writer: Martin Garrix.
6 Alan Walker

Diamond Heart flac

Alan Walker. 2018. Writer: Alan Walker;Sophia Somajo;Mood Melodies;James Njie;Thomas Troelsen;Kristoffer Haugan;Edvard Normann;Anders Froen;Gunnar Greve;Yann Bargain;Victor Verpillat;Fredrik Borch Olsen.
7 Cardi B

Taki Taki flac

Cardi B. 2018. Writer: Bava;Juan Vasquez;Vicente Saavedra;Jordan Thorpe;DJ Snake;Ozuna;Cardi B;Selena Gomez.
8 Bradley Cooper

Shallow flac

Bradley Cooper. 2018. Writer: Andrew Wyatt;Anthony Rossomando;Mark Ronson;Lady Gaga.
9 Post Malone

Sunflower flac

Post Malone. 2018. Writer: Louis Bell;Billy Walsh;Carter Lang;Swae Lee;Post Malone.
10 Dyro

Latency flac

Dyro. 2018. Writer: Martin Garrix;Dyro.
11 Zara Larsson

Ruin My Life flac

Zara Larsson. 2018. Writer: Delacey;Michael Pollack;Stefan Johnson;Jordan Johnson;Sermstyle;Jackson Foote.
12 ZAYN

Fingers flac

ZAYN. 2018. Writer: Zayn Malik;Alex Oriet;David Phelan.
13 Halsey

Without Me flac

Halsey. 2018. Writer: Halsey;Delacey;Louis Bell;Amy Allen;Justin Timberlake;Timbaland;Scott Storch.
14 Lady Gaga

I'll Never Love Again flac

Lady Gaga. 2018. Writer: Benjamin Rice;Lady Gaga.
15 Sia

I'm Still Here flac

Sia. 2018. Writer: Sia.
16 Dewain Whitmore

Burn Out flac

Dewain Whitmore. 2018. Writer: Dewain Whitmore;Ilsey Juber;Emilio Behr;Martijn Garritsen.
17 Little Mix

Woman Like Me flac

Little Mix. 2018. Writer: Nicki Minaj;Steve Mac;Ed Sheeran;Jess Glynne.
18 Mako

Rise flac

Mako. 2018. Writer: Riot Music Team;Mako;Justin Tranter.
19 Blinders

Breach (Walk Alone) flac

Blinders. 2018. Writer: Dewain Whitmore;Ilsey Juber;Blinders;Martin Garrix.
20 Rita Ora

Let You Love Me flac

Rita Ora. 2018. Writer: Rita Ora.

Related questions

Hot questions

Language

Popular Tags