`
zachary027
  • 浏览: 2595 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

A closer look at the Android project build system part I

 
阅读更多

摘自:http://www.androidenea.com/2009/04/closer-look-at-android-project-build.html

 

In this two part post we will take a closer look at the structure of the build system for native functionality. The build system is based on make and resides in the build folder in the project. The first part will look at what is found in this folder while the second part discusses the Android.mk file and options.

envsetup.sh
There is one important file in build directory itself. That is the envsetup.sh file. This shell script contains a lot of functionality that is nice to have when working with Android. To invoke it type

. build/envsetup.sh


in the android root directory. This will allow you to use a number of new commands including:

m - make from the top of the tree
mm - builds all modules in the current directory
cgrep - grep in all c-files
jgrep - grep in all java-files
mgrep - grep in all makefiles
lunch - choose build target


These shell commands are very useful when working with the platform. Whether you are looking for something specific in a source file or you just want to build the current module for a test.

build/target
The target directory contains make configurations for different boards and products. The target directory is where new products can be added as needed by a hardware manufacturer. In the current release there is a generic product description, and sdk product and some other files. The available boards are the emulator, a generic board and the simulator.

The board makefiles describe the hardware platform level and can be shared among a number of products. For example you can build both the generic product and the generic_with_google product to run on in the emulator.

The makefiles for different products are listed in the fileAndroidProducts.h. To add a new product put the makefile in the build/target/product folder and add the product toAndroidProduct.h. It is possible for product makefiles to inherit from each other to reduce the need for copying. The generic_with_google products inherits the generic product that inherits the core product to make up a three level product specification.

build/core
The core folder is the location of the build system files. These files are used to set up the build system and to build all the different modules as configured in the individual Android.mk files. The main.mk file is the entry point to the build system and it is this files that is included in the top level makefile in the project root directory. The build system can also be invoked by the shell command mm with at subset of the makefiles

The include order and hierarchy of the makefiles is rather complicated but an attempt of illustration can be found in this figure.


Most of the build configuration is set in theconfig.mkfile and thedefinitions.mkfile contains the functions to be invoked for the different source types. In the above figure the build system is invoked to build a shared library. The Android makefile uses theBUILD_SHARED_LIBRARYvariable set in theconfig.mkfile. This will set the build chain for building a shared library in a number of steps using several other files.

 

分享到:
评论

相关推荐

    Your State is Not Mine A Closer Look at Evading Stateful Internet Censorship

    Your State is Not Mine A Closer Look at Evading Stateful Internet Censorship

    A Closer Look at Spatiotemporal Convolutions for Action Recognition

    ### 深度解析时空卷积在动作识别中的应用 #### 摘要与引言概览 本文探讨了多种形式的时空卷积在视频分析中的应用,并研究了它们对动作识别的影响。作者的主要动机来源于观察到:在动作识别领域,应用于单个视频帧...

    a project model for the FreeBSD Project.7z

    [1] This paper will provide such a project model and is donated to the FreeBSD Documentation project where it can evolve together with the project so that it can at any point in time reflect the way ...

    【CVPR2018】A Closer Look at Spatiotemporal Convolu

    标题中的"【CVPR2018】A Closer Look at Spatiotemporal Convolutions for Action Recognition"指的是在2018年的计算机视觉与模式识别大会(CVPR)上发表的一篇研究论文,该论文主要探讨了针对动作识别的时空卷积...

    A comparison of the PIAT and WRAT: A closer look

    A comparison of the PIAT and WRAT: A closer look A COMPARISON OF THE PIAT AND WRAT: A CLOSER LOOK’ JOHN WALDEN, JR. BriuonliU Central S c h k , Troy, NY A sam le of 46 white fourth-grade ...

    Creating the OutLookRichEdit Control

    Before that, have a closer look at the preceding code and hypertext syntax. The link text is enclosed between the "$" symbols and the corresponding dialog's resource value 100 (About Box), enclosed ...

    计算机专业英语(PDF)

    计算机专业英语是编程和IT领域中的重要组成部分,尤其对于那些希望深入学习国际最新技术或阅读英文原版文档的初学者而言。这份“计算机专业英语”PDF教程为学习者提供了宝贵的资源,帮助他们提升专业词汇和阅读理解...

    Professional Android 4 Application Development 源代码

    A Closer Look at Android Activities Chapter 4: Understanding Fragments Fundamental Android UI Design Android User Interface Fundamentals Introducing Layouts To-Do List Example Introducing Fragments ...

    Agile Project Management with Scrum

    Thus the short feedback loop becomes a business feedback loop—Scrum tests early and often whether the system being developed will deliver value and exactly what that value will look like. This ...

    SamsTeachYourself tcpip

    suite, and you’ll get a close look at how the protocols of TCP/IP build the foundation for the rich ecosystem of tools and services we know as the Internet. The fifth edition includes new material on...

    Project Management

    Project Management is a fast-growing and increasingly 'professionalised' discipline with record numbers of practitioners now gaining the PRINCE qualification. The formal tools and techniques of ...

    BRKCRS-2810_Software Defined Access Under The Hood.pdf

    Are you facing some, or all, of ... Come to this session to get a look into the Cisco SD-Access architecture, including a closer look at each of the technologies that brings this architecture to life!

    Everydata.The.Misinformation.Hidden.in.the.Little.Data.You.Consume

    Chapter 3 Red State Blues: Averages and Aggregates—A Closer Look at Summary Statistics Chapter 4 Are You Smarter Than an iPhone-Using, Radiohead-Loving Republican?: Understanding Correlation Versus ...

    恶意软件查杀助理 11.05 简体绿软版_查杀超过460多款恶意

    恶意软件查杀助理 11.05 简体绿软版_查杀超过460多款恶意 更多精彩,欢迎来我的论坛逛逛! 快乐论坛630 http://hanranran.5d6d.com/bbs.php 快乐网赚论坛 http://wangzhuan630.5d6d.com/bbs.php ...

    Building Trading Bots Using Java [2016]

    In this book, you will learn about the nitty-gritty of automated trading and have a closer look at Java, the Spring Framework, event-driven programming, and other open source APIs, notably Google's ...

Global site tag (gtag.js) - Google Analytics