Android supports modular compilation and can compile a module, such as a browser.
1. Go to the android source code root directory and execute source build/envsetup. Sh;
2. You can execute compilation commands for mm, mmm, and other modules. To compile audioflinger, run Mmm frameworks/base/services/audioflinger/-B.
3. Make-Snod to regenerate the system. IMG image.
Remove some annotations of envsetup. Sh as follows:
Invoke ". Build/envsetup. Sh" from your shell to add the following functions to your environment:
-Croot: Changes directory to the top of the tree.
-M: makes from the top of the tree.
-Mm: builds all of the modules in the current directory.
-Mmm: builds all of the modules in the supplied directories.
-Cgrep: greps on all local C/C ++ files.
-Jgrep: greps on all local java files.
-Resgrep: greps on all local Res/*. XML files.
-Godir: Go to the directory containing a file.
Compile the make command for Android source code
Makefile
Makefile conforming to the GNU makefiel Convention contains some basic pre-defined operations:
Make
Compile the source code, connect to generate the target file, and execute the file according to makefile.
Make clean
Clear the object files generated by the last make command (Files suffixed with ". O") and executable files. Only the previously compiled executable files and configuration files are cleared.
Make distclean: Clear all generated files, including the files generated by configure, such as makefile.
Make install
Install the compiled executable files to the system directory, which is generally the/usr/local/bin directory.
Make Dist
Generate the release package file (distributionpackage ). This command will pack executable files and related files into a tar.gz compressed file for software release.
A file named "package-version.tar.gz" will be generated in the current directory. Package and version are the am_init_automake (package, Version) defined in Configure. In ).
Make distcheck
Generate and test the release package to confirm the correctness of the release package. This operation will automatically unbind the compressed package file, execute the configure command, and execute make to confirm that there is no error in compilation, and finally prompt that your software package is ready and can be released.
Make distclean is similar to make clean, but it also deletes all files generated by configure, including makefile.