The Android NDK build system is actually GNU Make . All code in the Android.mk file must be a valid make
.
When you run $ (shell) and don't save the value in a variable, it looks like you copied the standard script output to your Android.mk file. that is, as if your file contained the following:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) echo is working LOCAL_MODULE := libecho_test LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY)
.. which is invalid, does the syntax. Redirecting to> & 2 in your script works because the output goes to the error output and then displays on the console.
As Vishrut mentions, use $ (info) or $ (warning) to print messages. Or if you really want to run the script at build time, save its output in a variable:
ECHO_RESULT := $(shell ($(LOCAL_PATH)/echo_test.sh))
Here you will not see the echo output of the script, it goes into a variable.
richq source share