ITPub博客

首页 > > > LOCAL_MODULE := $(1)

LOCAL_MODULE := $(1)

作者:dapan 时间:2018-12-03 15:21:41 0 删除 编辑

Android.mk里面的这个写法,我第一眼看到的时候,表情是这样的。

完整的代码如下

#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH:= $(call my-dir)

# $1 is the *.sh file to copy

define script_to_copy
include $(CLEAR_VARS)
LOCAL_MODULE := $(1)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_OWNER := intel
LOCAL_SRC_FILES := $(1)
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_PREBUILT)

endef

script_list := logcat_ep.sh start_log_srv.sh init.npk.sh elogs.sh

$(foreach script,$(script_list),$(eval $(call script_to_copy,$(script))))


这个运行后的效果是把script_list几个脚本拷贝到system/vendor/bin 目录下,然后看了几个网站,还是不知所然,后面看到个老外写的注释

As part of Treble project in Android O, all the device specific files have
to be located in a separate vendor partition. This is done by setting
LOCAL_PROPRIETARY_MODULE (the name is misleading). This change will not
break existing platforms without a vendor partition as it will just move
files to /system/vendor.

Signed-off-by: Rob Herring <robh@kernel.org>
---
Testing on prior Android versions would be appreciated. I don't think
there should be any issues as /vendor has been supported for some time.

Android.common.mk | 4 ++--
src/egl/Android.mk | 1 +
src/gallium/targets/dri/Android.mk | 1 +
src/gbm/Android.mk | 1 +
src/intel/Android.vulkan.mk | 1 +
src/mapi/Android.mk | 1 +
src/mesa/drivers/dri/i915/Android.mk | 1 +
src/mesa/drivers/dri/i965/Android.mk | 1 +
8 files changed, 9 insertions(+), 2 deletions(-)

LOCAL_PROPRIETARY_MODULE 表示把文件放到system/vendor下

然后LOCAL_MODULE_CLASS := EXECUTABLES 表示可执行文件,拷贝到bin下面。



欢迎关注微信公众号-嵌入式Linux

觉得不错,请帮忙转发,点赞,您的每一次支持,我都将铭记于心

原文作者:;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-08-07

  • 博文量
    4504
  • 访问量
    87095