Download and compile the source code
--fourth chapter reading notes and Experience
Read the book to learn the difference between Android source code and Linux source code, and understand what Android porting is. Knowing that the Android migration is the Linux kernel porting, and the Linux kernel porting is mainly Linux drive porting. In order to develop and test the kernel environment, we need to build the environment and then know how to build the environment. Know how to download Android/linux source code and configure the Android source code download environment (and know that the Android source code download is not necessarily to the 4MB more things to download, you can also pick the things you need to download, you can use repo Sync command and the git clone command to do this). Understand the Android source code directory composition, in addition to the rest of the makefile file is a directory, storage of Android source code of different sub-projects. Learn how to compile the Android source code. Deepened the understanding of the second chapter of cross-compilation environment construction
There are two types of environments for Ubuntu Linux, namely the Android application development environment and the Linux kernel development environment.
Android source code contains a lot of things, such as the application source code in the Android system, the various tools of the Android SDK, the source code of the Android NDK, the source of the HAL. The environment also needs to be configured before downloading the Android source code:
(1) Create a directory to hold the downloaded script file (repo) (can be placed in any directory, using ~/bin)
# mkdir ~/bin
#PATH =~bin: $PATH
(2) Download repo script file (for download Android source code)
(3) Create a directory to hold the Android source code
(4) initialization
(5) Start download
Download good Android source code will be compiled, because the Android source code in each directory will contain the android.mk file, so the entire Android source code will be compiled recursively call each android.mk file to compile the current project. First, you need to initialize the compilation environment, then you need to select the target, and finally compile the Android source code. After compiling, an out directory is generated (the Out directory contains the host subdirectory and the target subdirectory).
# source Build/envsetup.sh
#. build/envsetup.sh
# lunch Full-eng (assuming target is Full-eng)
# MAKE-JN
The envsetup.sh script file is used to initialize some of the compile commands, and some shell functions are defined in the script file. It is possible to compile the Android source code through mm and MMM, but the former must be compiled into the directory of the specified project, which only needs to develop the project path. To compile the entire Android environment, you can use m instead of make.
Blog Park Address: http://www.cnblogs.com/zhanghui9505/
Android Deep Exploration--fourth chapter reading notes and Experiences