The latter had the effect of removing the benefit of optimization settings, i.e. a typical compiler
command would look like:
<toolchain-compiler> .... -Isources/<module-path> -I -O2 -g
The "-I -O2" was interpreted literally as "search in '-O2' directory, and the optimization was
never set to 2 (or 0 in case of debug mode).
# list of generated object files
LOCAL_OBJECTS :=
+# always define ANDROID when building binaries
+#
+LOCAL_CFLAGS := -DANDROID $(LOCAL_CFLAGS)
+
#
# Add the default system shared libraries to the build
#
$$(_OBJ): PRIVATE_CFLAGS := $$($$(my)CFLAGS) \
$$($$(my)_$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \
-I$$(LOCAL_PATH) \
- -I$$(OBJS_DIR) \
$$(LOCAL_CFLAGS) \
$$(NDK_APP_CPPFLAGS) \
$$(NDK_APP_CFLAGS) \
$$(_OBJ): PRIVATE_CXXFLAGS := $$($$(my)CXXFLAGS) \
$$($$(my)_$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \
-I$$(LOCAL_PATH) \
- -I$$(OBJS_DIR) \
$$(LOCAL_CFLAGS) \
$$(NDK_APP_CPPFLAGS) \
$$(NDK_APP_CXXFLAGS) \