Android build system Android.bp, Blueprint and Soong
http://note.qidong.name/2017/08/android-blueprint/
Tool chain relationships
Android.mk, Android.bp, Soong, Blueprint, Ninja, in the end what is the relationship between them? The following expression of the relationship between these concepts in a simple way.
Android.bp --> Blueprint --> Soong --> Ninja
Makefile or Android.mk --> kati --> Ninja
(Android.mk --> Soong --> Blueprint --> Android.bp)
Blueprint is generated, parsing Android.bp tool is part of Soong. Soong is a tool specifically designed for the Android build, Blueprint only form of parsing the file, and Soong to explain the meaning of the content.
Android.mk provided by Soong androidmk
into Android.bp conversion, but only a simple configuration. Currently compilation flow Oreo's, still use kati do the conversion.
Existing Android.mk, both of Android.bp, respectively, will be converted into a Ninja. Android.mk from other Makefile, it will generate a out/build-<product_name>.ninja
file. From Android.bp, it is generated out/soong/build.ninja
. In addition, also generates a smaller out/combined-<product_name>.ninja
file, responsible for the combination of the two, as the execution entry.
Finally, Ninja direct control file is the real source compiler tools.
Android 8.0 compilation preliminary analysis
https://blog.csdn.net/wear_/article/details/88543353
Overview
To know the process of compiling, in fact, look at the compiled scripts, and log generated at compile time is relatively fast method.
Compile the file is located in the core build / core, the generated files out / soong, there compile the file generated during compilation.
During compilation, the first to collect all files into android.bp out / soong / build.ninja.d, then this generation out / soong / build.ninja rule-based. Android.mk generated after collection is build-aosp_arm.jinja file.
Soong bp while the process of generating the file further comprises build.ninja out / soong / Android-aosp_arm.mk, the installation script file is compiled module is responsible for mounting the module to a corresponding position.
There are two files .minibootstrap / build.ninja and .bootstrap / build.ninja two directories in out / soong directory. .minibootstrap / build.ninja blueprint is mainly used to compile and generate .bootstrap / build.ninja. The .bootstrap / build.ninja mainly generated soong tools and out / soong / build.ninja file.
---------------------
Android8.0.0-r4 build system
https://blog.csdn.net/nwpushuai/article/details/79372837
I. Overview
1.1 compiler system change
From Android 7.0, android build system has changed, before the dependent Makefile organizations build system, from start to gradually introduce the 7.0 kati soong (optional not officially used, the need to open USE_SOONG = true), convert files to ninja Android.mk file using ninja file compiler system management.
From 8.0, android Android.mk introduced document file before Android.bp Alternatively, unlike Android.mk, Android.bp purely profile, does not include a branch, loop flow control and the like. How in the android project selection compiled, interpreted configured converted into ninja, etc., Soong was created, it will be managed Android.bp converted into a ninja files.
Meanwhile, Soong also compiles a androidmk longevity command manually convert into Android.bp Android.mk file.
1.2 Code Location
Kati position in the build / kati /, the platform also comes compiled ckati
Soong's position in the build / soong, it and build / blueprint of action at the same time, systematic relationship between them as follows:
Android.bp --> Blueprint --> Soong --> Ninja
Makefile or Android.mk --> kati --> Ninja
Blueprint is generated, parsing Android.bp tool is part of Soong. Soong is a tool designed for Android compiler designed, blueprint form just parse the file, and then explain the meaning of the content soong.
Go Blueprint and Soong are all written in the project, from the beginning of the new 7.0 operating environment go language in prebuilts / go / directory, compiled using.
1.3 Android ninja organization
During compilation, will collect all files into android.bp out \ soong \ build.ninja.d, and thus generate out \ soong \ build.ninja rule-based.
Build-aosp_arm.ninja file generated by all of the Android.mk. By combined-aosp_arm.ninja two files organized.
builddir = out
include out/build-aosp_arm.ninja
include out/soong/build.ninja
build out/combined-aosp_arm.ninja: phony out/soong/build.ninja
LOG compiled by first gathering all the bp file generation build.ninja, then collect all of the files generated build-aosp-arm.ninja mk file.
out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
out/build-aosp_arm-cleanspec.ninja is missing, regenerating...
out/build-aosp_arm.ninja is missing, regenerating...
[1/894] including out/soong/Android-aosp_arm.mk ...
After tests showed that, after the BP documents Soong process further comprises simultaneously generating build.ninja out / soong / Android-aosp_arm.mk, this file is compiled after installation script module is responsible for mounting the module to a corresponding position. For example vndk we are dealing with vendor-related treatment is carried out in this directory.
There are two files .minibootstrap / build.ninja and .bootstrap / build.ninja two directories in out / soong directory. .minibootstrap / build.ninja blueprint is mainly used to compile and generate .bootstrap / build.ninja. The .bootstrap / build.ninja mainly generated soong tools and out / soong / build.ninja file.
Second, the build process
compile step as follows:
1, source build / envsetup.sh: Load Command
2, lunch: choice platform compiler options
3, make: compile
---------------------