此参数会影响到库生成后的存放位置,影响生成位置的应该是相关平台下的变量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. Android应用程序的自动更新升级(自身升级、通过tomcat)(转)

    Android应用程序的自动更新升级(自身升级.通过tomcat) http://blog.csdn.net/mu0206mu/article/details/7204746 刚入手android一个 ...

  2. J2SE 8的Lambda --- functions

    functions //1. Runnable 输入参数:无 返回类型void new Thread(() -> System.out.println("In Java8!" ...

  3. shelve模块使用说明

    一种字典形式储存数据的方式 import datetime, shelve d = shelve.open('shelve_test.txt') info = {'age':22, 'job':'it ...

  4. Mysql 索引优化 - 2

    永远小表驱动大表(小数据驱动大数据) in exists区别, SELECT * FROM A WHERE A.id in (SELECT id FORM B) 若A表数据大于B表数据用in SELE ...

  5. UI5-文档-4.32-Routing with Parameters

    现在我们可以在overview和detail页面之间导航,但是我们在overview中选择的实际项目还没有显示在detail页面上.我们的应用程序的一个典型用例是在详细信息页面上显示所选项目的附加信息 ...

  6. spring cloud 服务提供者

    1. pom 依赖: <parent> <groupId>org.springframework.boot</groupId> <artifactId> ...

  7. JSTL标签库学习记录2-fmt

    fmt的标签为辅助性功能标签 设置编码 <fmt:requestEncoding value=""> 国际化相关 <fmt:setLocale value=&qu ...

  8. Boost.Coroutine2:学习使用Coroutine(协程)

    function(函数)routine(例程)coroutine (协程) 函数,例程以及协程都是指一系列的操作的集合. 函数(有返回值)以及例程(没有返回值)也被称作subroutine(子例程), ...

  9. Java Magic. Part 1: java.net.URL

    Java Magic. Part 1: java.net.URL @(Base)[JDK, url, magic, 黑魔法] 英文原文 转载请写明:原文地址 系列文章: -Java Magic. Pa ...

  10. Word 2003-在一个方框里打勾或打叉

    最近有个同事问我,如何在Word中输出一个方框中打勾的符号?查了一下帮助,其实很简单,特记录如下,供碰到的朋友参考: 一.在方框中打勾的方法: 先输入一个大写字母R,然后将R选中,将字体改为“Wind ...