1*9e94795aSAndroid Build Coastguard Worker#!/bin/bash 2*9e94795aSAndroid Build Coastguard Worker 3*9e94795aSAndroid Build Coastguard Worker# locate some directories 4*9e94795aSAndroid Build Coastguard Workercd "$(dirname $0)" 5*9e94795aSAndroid Build Coastguard WorkerSCRIPT_DIR="${PWD}" 6*9e94795aSAndroid Build Coastguard Workercd ../.. 7*9e94795aSAndroid Build Coastguard WorkerTOP="${PWD}" 8*9e94795aSAndroid Build Coastguard Worker 9*9e94795aSAndroid Build Coastguard Workermessage='The basic Android build process is: 10*9e94795aSAndroid Build Coastguard Worker 11*9e94795aSAndroid Build Coastguard Workercd '"${TOP}"' 12*9e94795aSAndroid Build Coastguard Workersource build/envsetup.sh # Add "lunch" (and other utilities and variables) 13*9e94795aSAndroid Build Coastguard Worker # to the shell environment. 14*9e94795aSAndroid Build Coastguard Workerlunch [<product>-<variant>] # Choose the device to target. 15*9e94795aSAndroid Build Coastguard Workerm [<goals>] # Execute the configured build. 16*9e94795aSAndroid Build Coastguard Worker 17*9e94795aSAndroid Build Coastguard WorkerUsage of "m" imitates usage of the program "make". 18*9e94795aSAndroid Build Coastguard WorkerSee '"${SCRIPT_DIR}"'/Usage.txt for more info about build usage and concepts. 19*9e94795aSAndroid Build Coastguard Worker 20*9e94795aSAndroid Build Coastguard WorkerThe parallelism of the build can be set with a -jN argument to "m". If you 21*9e94795aSAndroid Build Coastguard Workerdon'\''t provide a -j argument, the build system automatically selects a parallel 22*9e94795aSAndroid Build Coastguard Workertask count that it thinks is optimal for your system. 23*9e94795aSAndroid Build Coastguard Worker 24*9e94795aSAndroid Build Coastguard WorkerCommon goals are: 25*9e94795aSAndroid Build Coastguard Worker 26*9e94795aSAndroid Build Coastguard Worker clean (aka clobber) equivalent to rm -rf out/ 27*9e94795aSAndroid Build Coastguard Worker checkbuild Build every module defined in the source tree 28*9e94795aSAndroid Build Coastguard Worker droid Default target 29*9e94795aSAndroid Build Coastguard Worker sync Build everything in the default target except the images, 30*9e94795aSAndroid Build Coastguard Worker for use with adb sync. 31*9e94795aSAndroid Build Coastguard Worker nothing Do not build anything, just parse and validate the build structure 32*9e94795aSAndroid Build Coastguard Worker 33*9e94795aSAndroid Build Coastguard Worker java Build all the java code in the source tree 34*9e94795aSAndroid Build Coastguard Worker native Build all the native code in the source tree 35*9e94795aSAndroid Build Coastguard Worker 36*9e94795aSAndroid Build Coastguard Worker host Build all the host code (not to be run on a device) in the source tree 37*9e94795aSAndroid Build Coastguard Worker target Build all the target code (to be run on the device) in the source tree 38*9e94795aSAndroid Build Coastguard Worker 39*9e94795aSAndroid Build Coastguard Worker (java|native)-(host|target) 40*9e94795aSAndroid Build Coastguard Worker (host|target)-(java|native) 41*9e94795aSAndroid Build Coastguard Worker Build the intersection of the two given arguments 42*9e94795aSAndroid Build Coastguard Worker 43*9e94795aSAndroid Build Coastguard Worker snod Quickly rebuild the system image from built packages 44*9e94795aSAndroid Build Coastguard Worker Stands for "System, NO Dependencies" 45*9e94795aSAndroid Build Coastguard Worker vnod Quickly rebuild the vendor image from built packages 46*9e94795aSAndroid Build Coastguard Worker Stands for "Vendor, NO Dependencies" 47*9e94795aSAndroid Build Coastguard Worker pnod Quickly rebuild the product image from built packages 48*9e94795aSAndroid Build Coastguard Worker Stands for "Product, NO Dependencies" 49*9e94795aSAndroid Build Coastguard Worker senod Quickly rebuild the system_ext image from built packages 50*9e94795aSAndroid Build Coastguard Worker Stands for "SystemExt, NO Dependencies" 51*9e94795aSAndroid Build Coastguard Worker onod Quickly rebuild the odm image from built packages 52*9e94795aSAndroid Build Coastguard Worker Stands for "Odm, NO Dependencies" 53*9e94795aSAndroid Build Coastguard Worker vdnod Quickly rebuild the vendor_dlkm image from built packages 54*9e94795aSAndroid Build Coastguard Worker Stands for "VendorDlkm, NO Dependencies" 55*9e94795aSAndroid Build Coastguard Worker odnod Quickly rebuild the odm_dlkm image from built packages 56*9e94795aSAndroid Build Coastguard Worker Stands for "OdmDlkm, NO Dependencies" 57*9e94795aSAndroid Build Coastguard Worker sdnod Quickly rebuild the system_dlkm image from built packages 58*9e94795aSAndroid Build Coastguard Worker Stands for "SystemDlkm, NO Dependencies" 59*9e94795aSAndroid Build Coastguard Worker 60*9e94795aSAndroid Build Coastguard Worker 61*9e94795aSAndroid Build Coastguard WorkerSo, for example, you could run: 62*9e94795aSAndroid Build Coastguard Worker 63*9e94795aSAndroid Build Coastguard Workercd '"${TOP}"' 64*9e94795aSAndroid Build Coastguard Workersource build/envsetup.sh 65*9e94795aSAndroid Build Coastguard Workerlunch aosp_arm-userdebug 66*9e94795aSAndroid Build Coastguard Workerm -j java 67*9e94795aSAndroid Build Coastguard Worker 68*9e94795aSAndroid Build Coastguard Workerto build all of the java code for the userdebug variant of the aosp_arm device. 69*9e94795aSAndroid Build Coastguard Worker' 70*9e94795aSAndroid Build Coastguard Worker 71*9e94795aSAndroid Build Coastguard Workerecho "$message" 72