I have some *.cpp source files and some *.s ARM assembler files I want to assemble and link in my Android.mk file (by running ndk-build script).
My Android.mk file looks like this:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_MODULE := libTestJNI
LOCAL_SRC_FILES := Test.cpp TestAS_gas4.s
LOCAL_CFLAGS := -DHAVE_CONFIG_H -DFPM_ARM -ffast-math -O3 -DOPT_ARM
LOCAL_LDLIBS += -llog
include $(BUILD_SHARED_LIBRARY)
Unfortunately the *.s file is not recognized. ndk-build says:
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
make: *** No rule to make target `/cygdrive/c/projects/TestAS_gas4.s', needed by `/cygdrive/c/projects/obj/local/armeabi/objs-debug/libTestJNI/TestAS_gas4.o'. Stop.
In a "normal" makefile I would have to assemble by using "as" in a rule. How is it done in the Android.mk files?
/Kim
The Android.mk file resides in a subdirectory of your project's jni/ directory, and describes your sources and shared libraries to the build system. It is really a tiny GNU makefile fragment that the build system parses once or more.
NDK_PROJECT_PATH - the location of your project NDK_APPLICATION_MK - the path of the Application.mk file APP_BUILD_SCRIPT - the path to the Android.mk file. These are needed to override the default values of the build script, which expects things to be in the jni folder.
The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android and provides platform libraries you can use to manage native activities.
This is embarrasing but the problem was that the *.s files where located in a subfolder. The "No rule to make target" error is a very poor error description in this case.
/Kim
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With