blob: c405959ffe28327a0d88bf2a505ff1b5afb3c299 [file] [log] [blame]
Jeff Gastonc6dfc4e2017-05-30 17:12:37 -07001#!/bin/bash
2
3# locate some directories
4cd "$(dirname $0)"
5SCRIPT_DIR="${PWD}"
6cd ../..
7TOP="${PWD}"
8
9message='The basic Android build process is:
10
11cd '"${TOP}"'
12source build/envsetup.sh # Add "lunch" (and other utilities and variables)
13 # to the shell environment.
14lunch [<product>-<variant>] # Choose the device to target.
Colin Cross3fb7ddf2021-03-01 13:32:13 -080015m [<goals>] # Execute the configured build.
Jeff Gastonc6dfc4e2017-05-30 17:12:37 -070016
17Usage of "m" imitates usage of the program "make".
Dan Willemsen77338622017-11-08 16:39:18 -080018See '"${SCRIPT_DIR}"'/Usage.txt for more info about build usage and concepts.
Jeff Gastonc6dfc4e2017-05-30 17:12:37 -070019
Colin Cross3fb7ddf2021-03-01 13:32:13 -080020The parallelism of the build can be set with a -jN argument to "m". If you
Jaewoong Jungf9a2e4d2021-03-25 14:40:44 -070021don'\''t provide a -j argument, the build system automatically selects a parallel
Colin Cross3fb7ddf2021-03-01 13:32:13 -080022task count that it thinks is optimal for your system.
23
Jeff Gastonc6dfc4e2017-05-30 17:12:37 -070024Common goals are:
25
26 clean (aka clobber) equivalent to rm -rf out/
27 checkbuild Build every module defined in the source tree
28 droid Default target
Colin Cross17783422022-09-22 02:26:08 +000029 sync Build everything in the default target except the images,
30 for use with adb sync.
Jeff Gastonc6dfc4e2017-05-30 17:12:37 -070031 nothing Do not build anything, just parse and validate the build structure
32
33 java Build all the java code in the source tree
34 native Build all the native code in the source tree
35
36 host Build all the host code (not to be run on a device) in the source tree
37 target Build all the target code (to be run on the device) in the source tree
38
39 (java|native)-(host|target)
40 (host|target)-(java|native)
41 Build the intersection of the two given arguments
42
43 snod Quickly rebuild the system image from built packages
44 Stands for "System, NO Dependencies"
45 vnod Quickly rebuild the vendor image from built packages
46 Stands for "Vendor, NO Dependencies"
Jaekyun Seokb7735d82017-11-27 17:04:47 +090047 pnod Quickly rebuild the product image from built packages
48 Stands for "Product, NO Dependencies"
Justin Yun6151e3f2019-06-25 15:58:13 +090049 senod Quickly rebuild the system_ext image from built packages
50 Stands for "SystemExt, NO Dependencies"
Bowgo Tsaid624fa62017-11-14 23:42:30 +080051 onod Quickly rebuild the odm image from built packages
Yifan Hongcfb917a2020-05-07 14:58:20 -070052 Stands for "Odm, NO Dependencies"
53 vdnod Quickly rebuild the vendor_dlkm image from built packages
54 Stands for "VendorDlkm, NO Dependencies"
Yifan Hongf496f1b2020-07-15 16:52:59 -070055 odnod Quickly rebuild the odm_dlkm image from built packages
56 Stands for "OdmDlkm, NO Dependencies"
Ramji Jiyani13a41372022-01-27 07:05:08 +000057 sdnod Quickly rebuild the system_dlkm image from built packages
58 Stands for "SystemDlkm, NO Dependencies"
Jeff Gastonc6dfc4e2017-05-30 17:12:37 -070059
60
61So, for example, you could run:
62
63cd '"${TOP}"'
64source build/envsetup.sh
65lunch aosp_arm-userdebug
66m -j java
67
68to build all of the java code for the userdebug variant of the aosp_arm device.
69'
70
71echo "$message"