How to compile a project with Android.mk via a script.sh?

1

I have a simple project with native code and I'm using the manual command to compile /workspace/android-ndk-r11c/ndk-build TARGET_PLATFORM=android-14 TARGET_ARCH_ABI=armeabi NDK_PROJECT_PATH=. .

In my project I have Android.mk

LOCAL_PATH := $(call my-dir)

subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
        native_code \
    ))

ifeq($(TARGET_ARCH_ABI), armeabi-v7a)
    MY_INCLUDE := ../build/module_armeabi-v7a
endif

ifeq($(TARGET_ARCH_ABI), armeabi)
    MY_INCLUDE := ../build/module_armeabi
endif

ifndef MY_INCLUDE
$(error "You must define MY_INCLUDE before starting build_script.sh")
endif

include $(subdirs)

As seen in the Android.mk file above, I have the MY_INCLUDE variable, via ifeq($(TARGET_ARCH_ABI) and according to the architecture passed in TARGET_ARCH_ABI , I can compile for different architectures.

So with the command ndk-build I am able to compile perfectly, but I need to compile it, not through the command line with ndk-build , but through a build script that would also pass the variable MY_INCLUDE to Android.mk.

How could I compile by running the build_script.sh file?

    
asked by anonymous 20.06.2016 / 05:31

0 answers