NDK macros

Macros are small functions that contain a particular functionality. A few of them are defined by default by NDK. To call them, you must use the following syntax:

$(call <function-name>)

Here are a few of the default macros specified in the NDK:

  • my-dir: This macro returns the current path of the Android.mk file. It can be very useful when, initially, you want to set up LOCAL_PATH in the script:
    LOCAL_PATH := $(call my-dir)
    all-subdir-makefiles

    When this macro is executed, it returns as a list all the Android.mk makefiles that have been found in the folder returned by my-dir.

    By using this command, we can provide a better line of sub hierarchies and a better organization of the package structure.

  • parent-makefile: This returns the path where ...

Get Android High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.