Android 编译参数 LOCAL_MODULE_TAGS
此参数会影响到库生成后的存放位置,影响生成位置的应该是相关平台下的变量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 .
|
user |
"make user "
This is the flavor intended to be the final release bits.
|
userdebug |
"make userdebug "
The same as
|
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的更多相关文章
- 【转】高通平台android 环境配置编译及开发经验总结
原文网址:http://blog.csdn.net/dongwuming/article/details/12784535 1.高通平台android开发总结 1.1 搭建高通平台环境开发环境 在高通 ...
- 【转】Android Building System 总结 - 一醉千年 - CSDN博客
原文网址:http://www.360doc.com/content/15/0314/23/1709014_455175716.shtml Android Building System 总结 收藏 ...
- android.mk中LOCAL_MODULE_TAGS说明【转】
转自http://blog.csdn.net/evilcode/article/details/6459299 LOCAL_MODULE_TAGS :=user eng tests optional ...
- Android.mk文件LOCAL_MODULE_TAGS 说明
在移植wireless_tools驱动的时候发现居然没去编译咱的代码,奇怪,后来发现只有LOCAL_MODULE_TAGS 选项这个最有可疑,后来发现有这个说法 LOCAL_MODULE_TAGS : ...
- Android.mk学习 笔记
感谢: 原创作品 转载请注明出处:http://www.cnblogs.com/langlang/ 作者email: dayhappyhappy@163.com LOCAL_PATH := $(cal ...
- 理解 Android Build 系统
在配置了以上的文件之后,便可以编译出我们新添加的设备的系统镜像了. 首先,调用“source build/envsetup.sh”该命令的输出中会看到 Build 系统已经引入了刚刚添加的 vendo ...
- 深入理解:Android 编译系统
一,简介: Android Build 系统是用来编译 Android 系统,Android SDK 以及相关文档的一套框架.众所周知,Android 是一个开源的操作系统.Android 的源码中包 ...
- NDK(10)Android.mk各属性简介,Android.mk 常用模板
参考 : http://blog.csdn.net/hudashi/article/details/7059006 本文内容: Android.mk简介, 各属性表, 常用Android.mk模板 1 ...
- Android系统在超级终端下必会的命令大全(adb shell命令大全)
. 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...
随机推荐
- 机器学习入门-混淆矩阵-准确度-召回率-F1score 1.itertools.product 2. confusion_matrix(test_y, pred_y)
1. itertools.product 进行数据的多种组合 intertools.product(range(0, 1), range(0, 1)) 组合的情况[0, 0], [0, 1], [ ...
- wildFly(Jboss as)入门
目录 简介 安装 使用 简介 JBoss AS 从8版本起名为wildfly.JBoss是纯Java的EJB(企业JavaBean)服务器. JBoss As 由 Redhat出品的开源免费服务器,采 ...
- 前端开发-3-HTML-body标签
body标签 h.p.a.ul.ol.div.img. 想要在网页上展示出来的内容一定要放在body标签中. 把我们之前海燕那一段HTML代码贴过来,保存到一个HTML格式的文件中. <!DOC ...
- Java 使用getClass().getResourceAsStream()方法获取资源
之前想获取一个资源文件做一些处理,使用getClass().getResourceAsStream()一直拿不到文件. 具体的用法. 1 InputStream is = this.getClass( ...
- Java properties文件用法
package com.suyang.properties; import java.io.FileInputStream; import java.io.FileNotFoundException; ...
- Hive 和 HBase区别
作者:yuan daisy 链接:https://www.zhihu.com/question/21677041/answer/78289309 来源:知乎 著作权归作者所有.商业转载请联系作者获得授 ...
- 罗伯特•盖洛博士(Dr. Robert Charles Gallo)是世界著名的美国生物医学家,他以共同发现了人类免疫缺陷病毒(HIV)――这一导致获得性免疫缺陷综合症(AIDS)的致病源而闻名于世。
罗伯特•盖洛 开放分类:各国生物学家|生物学家罗伯特•盖洛博士(Dr. Robert Charles Gallo)是世界著名的美国生物医学家,他以共同发现了人类免疫缺陷病毒(HIV)――这一导致获得性 ...
- django1.8模板位置的设置setting.py
大多数django教程比较老,给出的template的设置方案为: 更改工程下的setting.py文件, TEMPLATE_DIRS = ( os.path.join( APP_DIR, ' ...
- Android 最火开发框架 xUtils
xUtils简介 xUtils3 api变化较多, 已转至 https://github.com/wyouflf/xUtils3 xUtils 2.x对Android 6.0兼容不是很好, 请尽快升级 ...
- avg(xxxxxx)什么时候能独自出现?
avg(xxxxxx)是作为求一组数据的平均数,需要有这组数据的总数和个数,所以通常配合着group by来使用, 比如: SELECT ID, AVG(GRADE) AS 平均数 FROM TEST ...