O'Reilly logo

Android NDK Beginner's Guide by Sylvain Ratabouil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering Makefiles

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.

Makefile variables

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 in Application.mk
  • LOCAL_ variables are dedicated to individual module compilation and are defined in Android.mk files
  • NDK_ are internal variables that usually refer to environment variables ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required