Android Build System

Revision as of 12:04, 15 July 2010 by Tim Bird (Talk | contribs) (add some notes about builder helper functions)

Jump to: navigation, search

Basics of the Android Build system are described at:

Note that "partner-setup" should be replaced with "choosecombo" or even "lunch" in that description.

(This information seems to be duplicated at: I'm going to assume that the site is the most up-to-date, but I haven't checked.)

More information about the Android build system, and some of the rationale for it, are described at:;a=blob_plain;f=core/build-system.html

You use build/ to set up a "convenience environment" for working on the Android source code. This file should be source'ed into your current shell environment. After doing so you can type 'help' for a list of defined functions which are helpful for interacting with the source.

Build tricks

build helper functions

A whole bunch of build helper functions are defined in the file build/core/

Try grep define build/core/ for an exhaustive list.

Here are some possibly interesting functions:

  • print-vars - shall all Makefile variables, for debugging
  • emit-line - output a line during building, to a file
  • dump-words-to-file - output a list of words to a file
  • copy-one-file - copy a file from one place to another (dest on target?)

Add a file directly to the output area

You can copy a file directly to the output area, without building anything, using the add-prebuilt-files function.

The following line, extracted from prebuilt/android-arm/gdbserver/ copies a list of files to the EXECUTABLES directory in the output area:

$(call add-prebuilt-files, EXECUTABLES, $(prebuilt_files))