安卓中添加C可执行程序源码
frameworks 中 添加 testing 目录
frameworks/testing$ ls -R
.:
Android.mk hello
./hello:
Android.mk hello_test.c
$ cat Android.mk
include $(call all-subdir-makefiles)
$ cat hello/Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= hello_test.c
LOCAL_MODULE:= hello_test
LOCAL_32_BIT_ONLY := true
include $(BUILD_EXECUTABLE)
$ cat hello/hello_test.c
#include <stdio.h>
int main(){
printf("hello android\n");
return 0;
}
mm 编译问题
[ 44% 4/9] target thumb C: hello_test <= frameworks/testing/hello/hello_test.c
[100% 9/9] Install: out/target/product/sw960/system/bin/hello_test
#### build completed successfully (03:30 (mm:ss)) ####
权限为 -rwxrwxr-x
全编译没生成 hello_test 文件,如果需要
vendor/qcom/proprietary/common/config/device-vendor.mk
# 需要确认 GPS_DBG 被编译进去
GPS_DBG += hello_test
其他,连接库及头文件问题