-
Book Overview & Buying
-
Table Of Contents
Android High Performance Programming
By :
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 the parent makefile can be found.
The command grand-parent-makefile also exists, and it returns, as obviously inferred, the path of the grandparent.
this-makefile: This macro returns the path of the current makefile.