Objective
The Android build system is part of the Android code. For information on how to obtain the Android source, please refer to the official Android source website:
Http://source.android.com/source/downloading.html.
The Android build system is used to compile the Android system, the Android SDK, and related documentation. The system consists primarily of make files, Shell scripts, and Python scripts, the most important of which are made files.
As we all know, Android is an open source operating system. Android's source code contains a large number of open source projects and many modules. Different manufacturers of various devices for the Android system customization is not the same.
How to manage the compilation of these projects and modules, how to compile on different operating systems, how to support different hardware devices, different types of compiling, and to provide customized extensions for various manufacturers are very difficult to compile.
But the Android build system solves these problems very well, and there are a lot of places to learn from our developers.
For Android platform developers, this article can help you familiarize yourself with the building environment you are exposed to every day.
For other developers, this article can be used as a use case for GNU make, learning these success stories to enhance our development experience.
Overview
The most important processing logic in the build system is in the make file, while the other script files are only auxiliary, and due to space limitations, this article explores only the contents of the make file.
Make files in the entire build system can be grouped into three categories:
The first category is the build system core file, which defines the framework for the entire builds system, and all other make files are written on the basis of this framework.
Figure 1 is the directory structure of the Android source tree, and the build system core files are all located in/build/core (all the paths mentioned in this article are in the background of the Android source tree, "/" refers to the root directory of the source tree, the file system-independent) directory.
Figure 1. Directory structure of the Android source tree