本文介绍了链接Android的C- code和ARM汇编的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经写了一个Android应用程序。它采用了主C- code模块和一个链接在C- code模块。现在我要替换与ARM汇编模块链接模块。任何人有一个简单的例子?谢谢你,罗杰
I have written an Android app. It uses a main C-code module and a linked-in C-code module. Now I want to replace the linked-in module with an ARM assembler module. Anyone have a simple example? Thanks, Roger
推荐答案
下面是将会建立一个包含sourcetree装配Android.mk文件的例子。要查看完整的例子检查分布在NDK包的Hello氖样本。
Here's an example of Android.mk file that will build sourcetree containing assembly. To see a complete example check the hello-neon sample distributed in the NDK package.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm # remove this if you want thumb mode
LOCAL_ARM_NEON := true # remove this if you want armv5 mode
LOCAL_CFLAGS := -std=c99 -pedantic -v
LOCAL_SRC_FILES := # list your C, C++ and assembly sources here.
# assembly source files ends with extension .S
# add .arm after the extension if you want to compile in armv5 mode (default is thumb)
# add .arm.neon to compile in armv7 mode
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := #the name of your shared library
include $(BUILD_SHARED_LIBRARY)
这篇关于链接Android的C- code和ARM汇编的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!