2017-05-31 02:12:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# locate some directories
|
|
|
|
cd "$(dirname $0)"
|
|
|
|
SCRIPT_DIR="${PWD}"
|
|
|
|
cd ../..
|
|
|
|
TOP="${PWD}"
|
|
|
|
|
|
|
|
message='The basic Android build process is:
|
|
|
|
|
|
|
|
cd '"${TOP}"'
|
|
|
|
source build/envsetup.sh # Add "lunch" (and other utilities and variables)
|
|
|
|
# to the shell environment.
|
|
|
|
lunch [<product>-<variant>] # Choose the device to target.
|
2021-03-01 22:32:13 +01:00
|
|
|
m [<goals>] # Execute the configured build.
|
2017-05-31 02:12:37 +02:00
|
|
|
|
|
|
|
Usage of "m" imitates usage of the program "make".
|
2017-11-09 01:39:18 +01:00
|
|
|
See '"${SCRIPT_DIR}"'/Usage.txt for more info about build usage and concepts.
|
2017-05-31 02:12:37 +02:00
|
|
|
|
2021-03-01 22:32:13 +01:00
|
|
|
The parallelism of the build can be set with a -jN argument to "m". If you
|
2021-03-25 22:40:44 +01:00
|
|
|
don'\''t provide a -j argument, the build system automatically selects a parallel
|
2021-03-01 22:32:13 +01:00
|
|
|
task count that it thinks is optimal for your system.
|
|
|
|
|
2017-05-31 02:12:37 +02:00
|
|
|
Common goals are:
|
|
|
|
|
|
|
|
clean (aka clobber) equivalent to rm -rf out/
|
|
|
|
checkbuild Build every module defined in the source tree
|
|
|
|
droid Default target
|
|
|
|
nothing Do not build anything, just parse and validate the build structure
|
|
|
|
|
|
|
|
java Build all the java code in the source tree
|
|
|
|
native Build all the native code in the source tree
|
|
|
|
|
|
|
|
host Build all the host code (not to be run on a device) in the source tree
|
|
|
|
target Build all the target code (to be run on the device) in the source tree
|
|
|
|
|
|
|
|
(java|native)-(host|target)
|
|
|
|
(host|target)-(java|native)
|
|
|
|
Build the intersection of the two given arguments
|
|
|
|
|
|
|
|
snod Quickly rebuild the system image from built packages
|
|
|
|
Stands for "System, NO Dependencies"
|
|
|
|
vnod Quickly rebuild the vendor image from built packages
|
|
|
|
Stands for "Vendor, NO Dependencies"
|
2017-11-27 09:04:47 +01:00
|
|
|
pnod Quickly rebuild the product image from built packages
|
|
|
|
Stands for "Product, NO Dependencies"
|
2019-06-25 08:58:13 +02:00
|
|
|
senod Quickly rebuild the system_ext image from built packages
|
|
|
|
Stands for "SystemExt, NO Dependencies"
|
2017-11-14 16:42:30 +01:00
|
|
|
onod Quickly rebuild the odm image from built packages
|
2020-05-07 23:58:20 +02:00
|
|
|
Stands for "Odm, NO Dependencies"
|
|
|
|
vdnod Quickly rebuild the vendor_dlkm image from built packages
|
|
|
|
Stands for "VendorDlkm, NO Dependencies"
|
2020-07-16 01:52:59 +02:00
|
|
|
odnod Quickly rebuild the odm_dlkm image from built packages
|
|
|
|
Stands for "OdmDlkm, NO Dependencies"
|
2022-01-27 08:05:08 +01:00
|
|
|
sdnod Quickly rebuild the system_dlkm image from built packages
|
|
|
|
Stands for "SystemDlkm, NO Dependencies"
|
2017-05-31 02:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
So, for example, you could run:
|
|
|
|
|
|
|
|
cd '"${TOP}"'
|
|
|
|
source build/envsetup.sh
|
|
|
|
lunch aosp_arm-userdebug
|
|
|
|
m -j java
|
|
|
|
|
|
|
|
to build all of the java code for the userdebug variant of the aosp_arm device.
|
|
|
|
'
|
|
|
|
|
|
|
|
echo "$message"
|