M: Compiling the entire Android system
Makes from the top of the tree
mm: Compile the current directory of the module , the current directory needs to have android.mk this makefile file, or go up to the nearest android.mk file.
Builds all of the moudles in the current directory
MMA: After adding or deleting files in the current directory, you can recompile with MMA.
mmm: Compile the module under the specified path , the path specified below needs to have android.mk this makefile file
Builds all of the moudles in the supplies directory
Mmma: After adding or deleting files in the specified directory, you can recompile with Mmma.
the compilation process of the MMM command:
BUILD/CORE/MAIN.MK (is the entry file for Android compilation system)
->BUILD/CORE/CONFIG.MK (compile type and target file will be fixed)
->BUILD/CORE/DEFINITIONS.MK (defines the macros used during compilation)
- >ONE_SHOT_MAKEFILE->BUILD/CORE/PACKAGE.MK (compile apk library file)
->build/core/java_library.mk (compiling Java library file)
->build/core/static_java_library.mk (compiling java static library file)
->build/core/shared_library.mk->build/core/dynamic_library.mk- >build/core/binary.mk->build/core/base_rules.mk
( calculates the values of some basic variables and creates some basic dependency rules)
   ->BUILD/CORE/STATIC_LIBRARY.MK (compile. A static library file)
->build/core/executable.mk (compile executable)
->build/core/prebuilt.mk (Compile a pre-compiled third-party library file)
->build/core/makfile (with System.img, boot.img, recovery.img and other image file generation rules)
The environment variable One_shot_makefile holds the file path to the android.mk of the module to be compiled, and if the environment variable value is empty, it means that the M or make command is executed, and all modules in the Android source code are compiled.
MM, MMM is similar, is used to compile some modules.
With these compile commands, you first need to configure the environment in the Android root directory
[Plain]View Plain Copy
- #source build/envsetup.sh to ensure that there are envsetup.sh script files in the current root directory
[Plain]View Plain Copy
- #choose ... The choice of the environment
[Plain]View Plain Copy
- #cd (the directory where the module is to be compiled)
[Plain]View Plain Copy
- #mm (MMA, MMM, Mmma)-b-j2 2>&1 start compiling the module
[Plain]View Plain Copy
- Note:-B means all files of the compiled module,-J2 indicates that two threads are opened at compile time, 2>&1 indicates that the error is switched to output (input is 0, output is 1, error 2).
- envsetup.sh script file contains definitions of vendorsetup.sh, lunch, M mm mmm
The difference between m, MM, MMM, MMA, Mmma in Android