Android makefiles are an essential piece of the NDK building process. Thus, it is important to understand the way they work, to build and manage a project properly.
Compilation settings are defined though a set of predefined NDK variables. We have already seen the three most important ones: LOCAL_PATH
, LOCAL_MODULE
, and LOCAL_SRC_FILES
. But many others exist. We can differentiate four types of variables, each with a different prefix: LOCAL_
, APP_
, NDK_
, and PRIVATE_
.
APP_
variables refer to application-wide options and are set inApplication.mk
LOCAL_
variables are dedicated to individual module compilation and are defined inAndroid.mk
filesNDK_
are internal variables that usually refer to environment variables (for example,NDK_ROOT
,NDK_APP_CFLAGS
orNDK_APP_CPPFLAGS
)PRIVATE_
prefixed variables are for NDK internal use only
Here is an almost exhaustive list: