In the Android source code directory under the build directory, there is a script file envsetup.sh;
$ . build/envsetup.sh
Note: the preceding comma (.) of the command is equivalent to source.
After executing this script file, you will get some useful tools:
-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 + + files.
-Jgrep:greps on all local Java files.
-Resgrep:greps on all local res/*.xml files.
-Godir:go to the directory containing a file.
We only focus on the MMM command, that is, it can be used to compile the specified module.
$ mmm hardware/libhardware/modules/slmo/
See: http://blog.csdn.net/luoshengyang/article/details/6566662
For Samsung sdmk4x12, the above method compiles the error, you need to select the menu and then edit:
$ source Build/envsetup.sh
$ lunch (pop-up options menu)
$7 (select Full_smdk4x12-eng)
Then, you can use MMM to compile a separate module.
Use Lunch-7 to select a menu item before using the command:
$ echo $TARGET _product
The value of target_product cannot be queried, but it can be set up:
$ echo $TARGET _product
full_smdk4x12 (target product)
In addition to Target_product, the following two values are set:
$ echo $TARGET _build_variant
Eng (Engineering test version)
$ echo $TARGET _build_type
Release (released version)
You can then use the following command to package the SYSTEM.IMG:
$ make Snod (Snod:system NO Dependent)
If you want to clean up the module, you can use the following command:
$ make Clean-slmotestapp (clean-module name)
If you want to clean all, you can use the following command:
$ make clean
The command will delete the entire out folder!
Android compilation, module compilation and clean