开发者

Android.mk - How to assemble and link ARM assembler files

开发者 https://www.devze.com 2023-02-03 21:10 出处:网络
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).

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


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


hint: change suffixes :

ln -fs %.s %.S.arm
0

精彩评论

暂无评论...
验证码 换一张
取 消