From 2eddd7da4941b375dca9f561c2a62073b03193f7 Mon Sep 17 00:00:00 2001 From: "ithink.chan" Date: Fri, 28 Jun 2019 11:45:34 +0800 Subject: [PATCH] =?UTF-8?q?Android=20external=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=8B=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA=E5=8F=AF=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=BA=94=E7=94=A8=E5=8F=8A=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ithink.chan --- ...external_目录下新增一个可执行应用及编译.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Software/OperatingSystem/Android/Development/Android_external_目录下新增一个可执行应用及编译.md diff --git a/Software/OperatingSystem/Android/Development/Android_external_目录下新增一个可执行应用及编译.md b/Software/OperatingSystem/Android/Development/Android_external_目录下新增一个可执行应用及编译.md new file mode 100644 index 0000000..da76d1e --- /dev/null +++ b/Software/OperatingSystem/Android/Development/Android_external_目录下新增一个可执行应用及编译.md @@ -0,0 +1,29 @@ +# [Android external 目录下新增一个可执行应用及编译](https://blog.csdn.net/loongembedded/article/details/76538470) + +新增的应用为 test 文件夹,此文件夹下包含 Android.mk 和 test.cpp 文件,Android.mk 内容如下: + +```sh +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := study.cpp + +LOCAL_MODULE := study + +LOCAL_MODULE_TAGS := optional + +LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) + +include $(BUILD_EXECUTABLE) +``` + +TARGET_OUT_EXECUTABLES 对应 out 目录下的,比如 out\target\product\msm8937_64\system\bin + +截止上面的修改,用 mmm external/study 可以编译生成 study 可执行文件到 out\target\product\msm8937_64\system\bin,但是整个系统编译的时候不会生成。为了在在整个系统编译的时候(比如make -j16)能够生成,还需要修改 device\qcom\common\base.mk,增加 + +PRODUCT_PACKAGES += study + +相关链接: + +[Android源码开发之添加/删除系统应用](http://blog.csdn.net/zrf1335348191/article/details/54907228)