Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android.mk conditions

Is there any way to use conditional expressions in Android.mk? I need it to do smth like this:

IF arch = AREABI_V7
   *use path for my arm_v7 static libs*
ELSE
   *use path for arm static libs*
like image 802
givi Avatar asked Dec 28 '11 17:12

givi


People also ask

How does Android MK work?

Overview. The Android.mk file resides in a subdirectory of your project's jni/ directory, and describes your sources and shared libraries to the build system. It is really a tiny GNU makefile fragment that the build system parses once or more.

What is Local_cflags?

LOCAL_CFLAGS is applied to the current module, and is undefined after an include $(CLEAR_VARS) . APP_CFLAGS is applied to all modules.

What is Ndk_project_path?

NDK_PROJECT_PATH - the location of your project NDK_APPLICATION_MK - the path of the Application.mk file APP_BUILD_SCRIPT - the path to the Android.mk file. These are needed to override the default values of the build script, which expects things to be in the jni folder.

How do I use IFEQ in Makefile?

The ifeq directive begins the conditional, and specifies the condition. It contains two arguments, separated by a comma and surrounded by parentheses. Variable substitution is performed on both arguments and then they are compared.


1 Answers

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
    ...
else
    ifeq($(TARGET_ARCH_ABI),armeabi)
        ...
    endif
endif
like image 108
Alexander Kulyakhtin Avatar answered Sep 30 '22 20:09

Alexander Kulyakhtin