博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android编译大全(六)
阅读量:4051 次
发布时间:2019-05-25

本文共 2208 字,大约阅读时间需要 7 分钟。

控制整个android系统编译的make文件。其内容如下:

### DO NOT EDIT THIS FILE ###

include build/core/main.mk

### DO NOT EDIT THIS FILE ###

 

可以看出,实际上控制编译的文件是:build/core/main.mk

命令

²  make droid:等同于make命令。droid是默认的目标名称。

²  make all  make allmake所有make droid会编译的项目。同时,将编译LOCAL_MODULE_TAGS定义的不包括android tag的模块。这将确保所有的在代码树里面同时有Android.mk文件的模块。

²  clean-$(LOCAL_MODULE)clean-$(LOCAL_PACKAGE_NAME)

删除某个模块的目标文件。例如:clean-libutils将删除所有的libutils.so以及和它相关的中间文件;clean-Home将删除Home应用。

²  make clean:删除本次配置所编译输出的结果文件。类似于:rm –rf ./out/ <configuration>

²  make clobber:删除所有配置所编译输出的结果文件。类似于:rm –rf ./out/

²  make datacleanmake dataclean deletes contents of the data directory inside the current combo directory. This is especially useful on the simulator and emulator, where the persistent data remains present between builds.

²  make showcommands:在编译的时候显示脚本的命令,而不是显示编译的简报。用于调试脚本。

²  make LOCAL_MODULE:编译一个单独得模块(需要有Android.mk文件存在)。

²  make targets:将输出所有拟可以编译的模块名称列表。

 

注:还有一些命令,从make文件里面应该可以找到。本文不做探讨。

config.mk文件的主要内容如下:

Ø  头文件的定义;(各种include文件夹的设定)

在定义头文件的部分,还includepathmap.mk,如下:

include $(BUILD_SYSTEM)/pathmap.mk

该文件设置include目录和frameworks/base下子目录等的信息。

Ø  编译系统内部mk文件的定义; <Build system internal files>

Ø  设定通用的名称;<Set common values>

Ø  Include必要的子配置文件;<Include sub-configuration files>

n  buildspec.mk

n  envsetup.mk

n  BoardConfig.mk

n  /combo/select.mk

n  /combo/javac.mk

Ø  检查BUILD_ENV_SEQUENCE_NUMBER版本号;

In order to make easier for people when the build system changes, when it is necessary to make changes to buildspec.mk or to rerun the environment setup scripts, they contain a version number in the variable BUILD_ENV_SEQUENCE_NUMBER. If this variable does not match what the build system expects, it fails printing an error message explaining what happened. If you make a change that requires an update, you need to update two places so this message will be printed.

·         In config/envsetup.make, increment the CORRECT_BUILD_ENV_SEQUENCE_NUMBER definition.

·         In buildspec.mk.default, update the BUILD_ENV_SEQUENCE_DUMBER definition to match the one in config/envsetup.make

The scripts automatically get the value from the build system, so they will trigger the warning as well.

Ø  设置常用工具的常量;< Generic tools.>

Ø  设置目标选项;< Set up final options.>

Ø  遍历并设置SDK版本;

转载地址:http://adici.baihongyu.com/

你可能感兴趣的文章
linux内核学习(7)脱胎换骨解压缩的内核
查看>>
以太网基础知识
查看>>
慢慢欣赏linux 内核模块引用
查看>>
kprobe学习
查看>>
慢慢欣赏linux phy驱动初始化2
查看>>
慢慢欣赏linux CPU占用率学习
查看>>
2020年终总结
查看>>
Homebrew指令集
查看>>
React Native(一):搭建开发环境、出Hello World
查看>>
React Native(二):属性、状态
查看>>
JSX使用总结
查看>>
React Native(四):布局(使用Flexbox)
查看>>
React Native(七):Android双击Back键退出应用
查看>>
Android自定义apk名称、版本号自增
查看>>
adb command not found
查看>>
Xcode 启动页面禁用和显示
查看>>
【剑指offer】q50:树中结点的最近祖先
查看>>
二叉树的非递归遍历
查看>>
【leetcode】Reorder List (python)
查看>>
【leetcode】Linked List Cycle (python)
查看>>