zoukankan      html  css  js  c++  java
  • Android编译,模块的编译和CLEAN

    在Android源代码目录下的build目录下,有个脚本文件envsetup.sh;
    $ . build/envsetup.sh
    注:该命令的前面的逗点(.),相当于source
    执行这个脚本文件后,就可以获得一些有用的工具:
    - croot: Changes directory to the top of the tree.
    - m: Makes from the top of the tree.
    - mm: Builds all of the modules in the current directory.
    - mmm: Builds all of the modules in the supplied directories.
    - cgrep: Greps on all local C/C++ files.
    - jgrep: Greps on all local Java files.
    - resgrep: Greps on all local res/*.xml files.
    - godir: Go to the directory containing a file.
    我们只关注mmm命令,也就是可以用它来编译指定的模块。
    $ mmm hardware/libhardware/modules/slmo/
    详见:http://blog.csdn.net/luoshengyang/article/details/6566662


    对三星SDMK4x12来说,上述方法编译报错,需要选择菜单后再编:
    $ source build/envsetup.sh
    $ lunch
    (弹出选项菜单)
    $ 7 (选择full_smdk4x12-eng)
    然后,可以使用mmm编译单独的模块了。

    使用lunch-7选择过菜单项之前,使用命令:
    $ echo $TARGET_PRODUCT
    查询不到TARGET_PRODUCT的值,而设置后就可以了:
    $ echo $TARGET_PRODUCT
    full_smdk4x12
    (目标产品)
    除了TARGET_PRODUCT外,还设置了如下两个值:
    $ echo $TARGET_BUILD_VARIANT
    eng
    (工程测试版本)
    $ echo $TARGET_BUILD_TYPE
    release
    (发布版本)

    然后,就可以使用如下命令,进行打包system.img了:
    $ make snod (snod: System NO Dependent)

    如果要清理该模块,可以使用如下的命令:
    $ make clean-SlmoTestApp (clean-模块名)

    如果要清理所有,可以使用如下的命令:
    $ make clean
    该命令,会删除整个out文件夹!

  • 相关阅读:
    检测iphone设备是否越狱
    iphone震动提示
    单线,双线
    塔式服务器
    IPHONE锁屏控制代码
    iPhone开发之显示WiFi提示
    代码关闭程序的几种方法
    获取手机左边音量+ -按键的事件方法或私有api
    1u
    servlet在什么时候调用destroy()方法
  • 原文地址:https://www.cnblogs.com/senior-engineer/p/4790861.html
Copyright © 2011-2022 走看看