引:因为博主需要完成一个需求,于是便认识了Android.mk。需求的目标就是将一系列文件Copy到系统的指定的目录下。
另外有RC启动二进制文件的例子:https://blog.csdn.net/qq_31332467/article/details/104754871
先看下本文需求中需要用到的文件:
如上所示:主要是将这些文件Copy的指的路径下,在系统启动之后可以被直接调用起来。
LOCAL_PATH := $(call my-dir)
## copy libcarplay_jni.so to system/lib64
include $(CLEAR_VARS)
LOCAL_MODULE := libcarplay_jni
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_SRC_FILES :=lib64/libcarplay_jni.so
LOCAL_MODULE_PATH :=$(PRODUCT_OUT)/system/lib64/
include $(BUILD_PREBUILT)
## copy CarPlayApp apk to system/app
include $(CLEAR_VARS)
LOCAL_MODULE := CarPlay
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_SUFFIX := .apk
LOCAL_SRC_FILES := apk/CarPlay.apk
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/app/
include $(BUILD_PREBUILT)
## prebuild mdnsd binary to /system/bin/
include $(CLEAR_VARS)
LOCAL_MODULE := mdnsd
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := bin/mdnsd
LOCAL_MODULE_PATH :=$(PRODUCT_OUT)/system/bin/
include $(BUILD_PREBUILT)
## copy init.qcom.test.rc from etc to /vendor/etc/init/hw
include $(CLEAR_VARS)
LOCAL_MODULE := CarPlayService
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := bin/CarPlayService
LOCAL_INIT_RC := etc/init.qcom.carplay.rc
LOCAL_MODULE_PATH :=$(PRODUCT_OUT)/system/bin/
include $(BUILD_PREBUILT)
## copy init.qcom.testscripts.sh from etc to /system/etc
include $(