I have a project organized as follow:
project/jni/Android.mk
project/jni/libA/Android.mk
project/jni/libB/Android.mk
project/lib/armeabi/libA.so
project/lib/armeabi/libB.so
My libA and libB are set on my main Android.mk as prebuilt libs cause I don't want them to be built every time I build my main Android.mk. Here is what I have:
///////////////// Main Android.mk /////////////////
LOCAL_PATH := $(call my-dir)
###########################################
# Declare the prebuilt A library
###########################################
include $(CLEAR_VARS)
LOCAL_MODULE := A-prebuilt
LOCAL_SRC_FILES := ../lib/$(TARGET_ARCH_ABI)/libA.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/libA
include $(PREBUILT_SHARED_LIBRARY)
###########################################
# Declare the prebuilt B library
###########################################
include $(CLEAR_VARS)
LOCAL_MODULE := B-prebuilt
LOCAL_SRC_FILES := ../lib/$(TARGET_ARCH_ABI)/libB.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/libB/include
include $(PREBUILT_SHARED_LIBRARY)
###########################################
# Declare our main module
###########################################
include $(CLEAR_VARS)
LOCAL_MODULE := libjnimain
LOCAL_SRC_FILES := \
main.c
# for logging
LOCAL_LDLIBS += -llog
# include the prebuilt libraries
LOCAL_SHARED_LIBRARIES := \
A-prebuilt \
B-prebuilt
#This will include all Android.mk files in sub-directories
#of the current build file's path.
include $(call all-subdir-makefiles)
include $(BUILD_SHARED_LIBRARY)
//////////////////////////////////////////////
The main problem I have is building the prebuild libraries. I can't seem to be able to build the libA or libB by calling their Android.mk because when I do the main Android.mk is called. Any help would be appreciated.
The main problem I have is building the prebuild libraries. I can't seem to be able to build the libA or libB by calling their Android.mk because when I do the main Android.mk is called. Any help would be appreciated.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/Ujr9l7dfq5EJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Ok, so essentially I need an Application.mk to specify the APP_BUILD_SCRIPT. Once I do that than I can actually selectively call to build libA and libB?
I do understand that once Android.mk builds properly it will store it as you mentioned under $PROJECT/libs/$ABI/ by default. Would the main Android.mk than remove those libraries? Cause I did see that...
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/ngqfiwQfQzMJ.