安卓中添加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
資源下載下傳
其他,連接配接庫及頭檔案問題