NotePublic/Software/Development/System/Android/Android_external_目录下新增一个可执行...

30 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# [Android external 目录下新增一个可执行应用及编译](https://blog.csdn.net/loongembedded/article/details/76538470)
新增的应用为 test 文件夹,此文件夹下包含 Android.mk 和 test.cpp 文件Android.mk 内容如下:
```ini
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)