4th Chapter Source code download and compile

Source: Internet
Author: User

The Android source code contains many things, embedded in the source code of the application and various tools. So we want to use someone else's Linux software to download his source code. To download the source code, you need to configure the Android source code download environment, first create a directory for the download script file (repo) and then download the repo script file (used to download the Android source code) and create a directory to hold the Android source code for the final initialization. You can start downloading the Android source code. If you want to use the downloaded code, you must understand the directory structure of the code, in these files in addition to the makefile file is a directory of these directories save the Android source code of different sub-projects, can refer to this section 4.12. Too much is not in the statement. Because people need different source code different sometimes we only need a small part of it, then we can use the Repo Sync command to get all the recovery project code, using the git clone command can download the specified project source code, The difference between the two methods is that repo generates a hidden directory in the current directory that contains all the information needed to download the Android source code. Repo sync Download the specified project source code will be stored according to the actual path, and Git clone will only establish the project directory, and will not establish a hierarchical path structure.

After the download is ready to compile the source code to achieve the final goal, the compile time to initialize the compilation environment: source build/envsetup.sh The second step to select the target: Lunch Full-eng to open all the debugging options to complete the above two steps in the compilation Android source code make MAK E-j4 to complete the final compilation. The Out directory is the default directory that holds the target files generated by the Android source code, where you can view the final results. The previous download of the Android source code does not contain the Linux kernel source code, so there is an important next step, download the Linux kernel source code through the command terminal input git clone URL to complete the code download, Linux source code structure (see book 4.22), after the download is completed, install the kernel compilation environment, note that the translation is to install the cross-compiler (in a-schema compilation on the build on the CPU on the B-schema to run the program). Compiler installation steps: Arm-linux-gcc-4.3.2.tgz file and arm ..... Copy the files to the working directory, unzip the compiler, verify that the cross compiler is installed successfully, install LIBNCURSES5, configure and compile the Linux kernel, and so on to complete the kernel compilation.

In fact, the migration of Android is the Linux kernel porting, and the Linux kernel migration is mainly a Linux-powered migration, so the development and testing of Linux drivers. Two sets of development environments need to be built under the system to transplant the port.

4th Chapter Source code download and compile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.