此参数会影响到库生成后的存放位置,影响生成位置的应该是相关平台下的变量PRODUCT_PACKAGES

http://blog.csdn.net/evilcode/article/details/6459299

LOCAL_MODULE_TAGS :=user eng tests optional

user: 指该模块只在user版本下才编译

eng: 指该模块只在eng版本下才编译

tests: 指该模块只在tests版本下才编译

optional:指该模块在所有版本下都编译

eng This is the default flavor. A plain "make" is the same as "make eng". droid is an alias for eng. 
  * Installs modules tagged with: eng, debug, user, and/or development. 
  * Installs non-APK modules that have no tags specified. 
  * Installs APKs according to the product definition files, in addition to tagged APKs. 
  * ro.secure=0 
  * ro.debuggable=1 
  * ro.kernel.android.checkjni=1 
  * adb is enabled by default.

user "make user"     This is the flavor intended to be the final release bits. 
  * Installs modules tagged with user. 
  * Installs non-APK modules that have no tags specified. 
  * Installs APKs according to the product definition files; tags are ignored for APK modules. 
  * ro.secure=1 
  * ro.debuggable=0 
  * adb is disabled by default.

userdebug "make userdebug"     The same as user, except: 
  * Also installs modules tagged with debug. 
  * ro.debuggable=1 
  * adb is enabled by default.

Build flavors/types

When building for a particular product, it's often useful to have minor variations on what is ultimately the final release build. These are the currently-defined "flavors" or "types" (we need to settle on a real name for these).

eng This is the default flavor. A plain "make " is the same as "make eng ". droid is an alias for eng .

  • Installs modules tagged with: eng , debug , user , and/or development .
  • Installs non-APK modules that have no tags specified.
  • Installs APKs according to the product definition files, in addition to tagged APKs.
  • ro.secure=0
  • ro.debuggable=1
  • ro.kernel.android.checkjni=1
  • adb is enabled by default.
user "make user "

This is the flavor intended to be the final release bits.

  • Installs modules tagged with user .
  • Installs non-APK modules that have no tags specified.
  • Installs APKs according to the product definition files; tags are ignored for APK modules.
  • ro.secure=1
  • ro.debuggable=0
  • adb is disabled by default.
userdebug "make userdebug "

The same as user , except:

  • Also installs modules tagged with debug .
  • ro.debuggable=1
  • adb is enabled by default.

If you build one flavor and then want to build another, you should run "make installclean " between the two makes to guarantee that you don't pick up files installed by the previous flavor. "make clean " will also suffice, but it takes a lot longer.

Android 编译重要参数 LOCAL_MODULE_TAGS

最近移植tslib库到android系统,发现编译好的库和测试工具竟然没有输入到out/target/product/Ok6410/system/lib 和 out/target/product/Ok6410/system/bin下面,感觉很奇怪,于是下定决心看一下,到底输入到了哪里。

过程如下:

tslib的源代码放到了android2.3 源代码下 vendor 目录 (android2.3中自己添加,如何设置自己的vendor 我的博客中有说明)forlinx/OK6410/的下面. tslib目录下面的 Android.mk写好以后,重新make clean 整个android源码,再次make 编译通过,奇怪的是输出目录 out/target/product/Ok6410/system/bin 下面竟然没有tslib相关的工具,而是放在了out/target/product/OK6410/symbols/system/bin 下面,在做打包文件时,由于没有把symbols文件夹放到文件系统里面,所以校准功能不能实现。(事实上提取文件系统过程中也不应该把symbols文件夹考虑在内)。

最后查找原因 ,是因为tslib文件下的Android.mk文件里面,LOCAL_MODULE_TAGS变量设置的有问题。

LOCAL_MODULE_TAGS :=optional

把这项改为

LOCAL_MODULE_TAGS :=eng即可

原因是LOCAL_MODULE_TAGS 变量跟TARGET_BUILD_VARIANT 变量息息相关。 android系统编译时如果不指定

TARGET_BUILD_VARIANT 变量的值,默认 TARGET_BUILD_VARIANT=eng ,这一项指定 编译android时形成的版本风格,一般发布时使用这个值,当然还有user,debuguser等风格值,具体看一下这个链接http://android.git.kernel.org/?p=platform/build.git;a=blob_plain;f=core/build-system.html;h=43bae03b6b7b9cba678b86d2faf424fa565497bf;hb=HEAD,如果打不开,翻个墙就可以。

这样设置好以后,重新编译,输出目录out/target/product/Ok6410/system/bin ,out/target/product/Ok6410/system/lib里面就有tslib 相关的库和测试程序了。

所以,如果自己需要加额外的模块,或者应用程序,一定要注意Android.mk里面的这个变量,当然了,如果你指定了LOCAL_MODULE_TAGS :=optional,也能编译出来,但是存放的输入路径就不是一般的

out/target/product/Ok6410/system/目录了,而是out/target/product/OK6410/symbols/system/目录。

后来自己在android源代码的 external目录下面放了一个模块,指定该模块的编译风格为LOCAL_MODULE_TAGS :=optional,重新编译,通过以后,竟然直接输出到了out/target/product/Ok6410/system/ 目录,很是惊讶,个人认为还跟模块存放的目录有关.所以无论模块在哪个文件夹下面,最好指定的值跟TARGET_BUILD_VARIANT 相关,如果没指定TARGET_BUILD_VARIANT ,系统会默认设置TARGET_BUILD_VARIANT =eng,你也就指定LOCAL_MODULE_TAGS :=eng

目前自己遇到的 vendor目录,hardware目录下面的模块输出路径跟LOCAL_MODULE_TAGS 有很大的关系

LOCAL_MODULE_TAGS :=optional >> out/target/product/OK6410/symbols/system/

LOCAL_MODULE_TAGS :=eng    >> out/target/product/Ok6410/system/

当然前提是TARGET_BUILD_VARIANT=eng .

下面是网友遇到的类似问题:

"Set LOCAL_MODULE_TAGS to any number of whitespace-separated tags.

This variable controls what build flavors the package gets included
in. For example:

* user: include this in user/userdebug builds
    * eng: include this in eng builds
    * tests: the target is a testing target and makes it available for tests
    * optional: don't include this"

Are these the same as "variants" and if so, which name would affect
the build and how? I've noticed that everything mentioned in a
product's makefile will always get built. But what gets in the final
system.img not always the same as what gets built.
http://groups.google.com.tw/group/android-platform/browse_thread/thread/a4f70254a2ceb622 
http://android.git.kernel.org/?p=platform/build.git;a=blob_plain;f=core/build-system.html;h=43bae03b6b7b9cba678b86d2faf424fa565497bf;hb=HEAD

以上是自己在移植android2.3过程中发现的一个问题,如果您也遇到了,并且认为我的解释存在问题,请指出,以免给大家带来误解。

Android 编译参数 LOCAL_MODULE_TAGS的更多相关文章

  1. 【转】高通平台android 环境配置编译及开发经验总结

    原文网址:http://blog.csdn.net/dongwuming/article/details/12784535 1.高通平台android开发总结 1.1 搭建高通平台环境开发环境 在高通 ...

  2. 【转】Android Building System 总结 - 一醉千年 - CSDN博客

    原文网址:http://www.360doc.com/content/15/0314/23/1709014_455175716.shtml  Android Building System 总结 收藏 ...

  3. android.mk中LOCAL_MODULE_TAGS说明【转】

    转自http://blog.csdn.net/evilcode/article/details/6459299 LOCAL_MODULE_TAGS :=user eng tests optional ...

  4. Android.mk文件LOCAL_MODULE_TAGS 说明

    在移植wireless_tools驱动的时候发现居然没去编译咱的代码,奇怪,后来发现只有LOCAL_MODULE_TAGS 选项这个最有可疑,后来发现有这个说法 LOCAL_MODULE_TAGS : ...

  5. Android.mk学习 笔记

    感谢: 原创作品 转载请注明出处:http://www.cnblogs.com/langlang/ 作者email: dayhappyhappy@163.com LOCAL_PATH := $(cal ...

  6. 理解 Android Build 系统

    在配置了以上的文件之后,便可以编译出我们新添加的设备的系统镜像了. 首先,调用“source build/envsetup.sh”该命令的输出中会看到 Build 系统已经引入了刚刚添加的 vendo ...

  7. 深入理解:Android 编译系统

    一,简介: Android Build 系统是用来编译 Android 系统,Android SDK 以及相关文档的一套框架.众所周知,Android 是一个开源的操作系统.Android 的源码中包 ...

  8. NDK(10)Android.mk各属性简介,Android.mk 常用模板

    参考 : http://blog.csdn.net/hudashi/article/details/7059006 本文内容: Android.mk简介, 各属性表, 常用Android.mk模板 1 ...

  9. Android系统在超级终端下必会的命令大全(adb shell命令大全)

    . 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...

随机推荐

  1. Alpha版本检测报告

    1.Alpha版本测试报告 发布一篇随笔,作为项目的测试报告,内容包括: (1)测试计划 测试人员 工作安排 覃一霸 编写测试报告 张江波 执行测试.截图测试结果 测试功能 功能 描述 效果 结果 登 ...

  2. 【独家】完美解决appium安装app时,需要手动确认安装的问题

    appium初始化driver时,如果未安装该app会先进行安装,安装时,很多安卓手机都会弹框,需要手动确认安装. 如小米的机器, 这是个头疼的问题,之前在网上找遍了,只有通过adb去点相对坐标成功了 ...

  3. sendkeys

    1)为了指定单一键盘字符,必须按字符本身的键.例如,为了表示字母 A,可以用 "A" 作为 string.为了表示多个字符,就必须在字符后面直接加上另一个字符.例如,要表示 A.B ...

  4. 7 python 模块间相互导入

    python在不同层级目录import模块的方法 注意,在python3里,即使目录下没__int__.py文件也能创建成功,猜应该是解释器优化所致,但创建包还是要记得加上这个文件 吧. 1.模块的分 ...

  5. windows下的java项目打jar分别编写在windows与linux下运行的脚本( 本人亲测可用!)

    前言: 最近公司做了一个工具,要将这个工具打包成一个可运行的程序,编写start.bat和start.sh在windows和linux下都可以运行. 在网上找了很多资料,最后终于找到一个可靠的资料,记 ...

  6. 数据恢复软件extundelete介绍

    linux下文件系统一般由文件名.Inode.Block三部分组成.当一个用户在Linux系统中试图访问一个文件时,系统会先根据文件名去查找它的inode,看该用户是否具有访问这个文件的权限.如果有, ...

  7. Numpy 常用函数

    保存文件i3 = eye(3) 创建一个3*3 的单位矩阵savetxt('eye.txt',i3) #保存矩阵 读取文件c,v=np.loadtxt('data.csv', delimiter=', ...

  8. Numpy 基础知识

    1.使用ipython --pylab 自动加载 Numpy.Scipy.Matplotlib模块. 创建数组a = arange(10) b = arange(10,dtype='f')c = ar ...

  9. plot绘图

    plot绘图 坐标系图(折线图) 折线图用于显示随时间或有序类别的变化趋势 plt.plot(x,y,format_string,**kwargs) y:Y轴数据,列表或数组,必选 x:X轴数据,列表 ...

  10. docker 入門

    http://dockone.io/article/277 我的碎碎念:Docker入门指南 [编者的话]之前曾经翻译过很多Docker入门介绍的文章,之所以再翻译这篇,是因为Anders的角度很独特 ...