Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK, No rule to make target

I've seen this question other places, but the answers don't seem to apply to my situation. I've got a .cpp file (not a .c file). I'm getting the error:

make: * No rule to make target jni/native.c', needed byobj/local/armeabi/objs/native/native.o'. Stop. Cirapi_android C/C++ Problem

Here's my Android.mk file (very simple):

LOCAL_PATH:=$(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS:=-llog
LOCAL_MODULE:=native
LOCAL_SRC_FILES:=native.cpp
include $(BUILD_SHARED_LIBRARY)

I've removed all the extra spaces that solved other's problems. It's complaining about native.c which I don't even have listed in my makefile. Any ideas?

I'm on MacOSX Snow Leopard, Eclipse Juno, NDK r8

like image 859
alexcir Avatar asked Jul 19 '12 22:07

alexcir


1 Answers

Got it to work...not sure what the key was...changed the makefile to..

TOP_LOCAL_PATH:=$(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TOP_LOCAL_PATH)  

include $(CLEAR_VARS)
LOCAL_LDLIBS:=-llog
LOCAL_MODULE:=native
LOCAL_SRC_FILES:=native.cpp

include $(BUILD_SHARED_LIBRARY)

...also removed the .o files from the obj directory...suspected that a clean was not working correctly.

like image 73
alexcir Avatar answered Sep 24 '22 18:09

alexcir