0

I have 2 Android.mk files with the first one building a bunch of libraries and the second one builds another library, but needs the first one to be complete before kicking off it's own build. Is there any way to make sure this happens?

This is what I've tried so far:

  1. LOCAL_ADDITIONAL_DEPENDENCIES := path/to/folder/for/android1.mk
  2. Order of listing of these Android.m files (1 & 2)
  3. Adding LOCAL_SHARED_LIBRARIES := a.so b.so ...

But, none of these have helped so far

######################################################################
# Android1.mk
######################################################################

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := a1.c a2.c
LOCAL_MODULE := lib_a
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := SHARED_LIBRARIES

include $(BUILD_SHARED_LIBRARY)

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := b1.c b2.c
LOCAL_MODULE := lib_b
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := SHARED_LIBRARIES

include $(BUILD_SHARED_LIBRARY)

######################################################################
# Android2.mk
######################################################################

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := abc.c xyz.c
LOCAL_MODULE := lib_2
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_ADDITIONAL_DEPENDENCIES := /path/to/folder/where/Android1.mk/resides

LOCAL_SHARED_LIBRARIES += \
    lib_a \
    lib_b

include $(BUILD_SHARED_LIBRARY)

The caveat is that abc.c/xyz.c doesn't make any calls in lib_a.so/lib_b.so/lib_z.so. But, I'm generating a script (in Android2.mk) and for that, require all the libraries (in Android1.mk) to be built prior

guipivoto
  • 18,327
  • 9
  • 60
  • 75
droid_dev
  • 303
  • 4
  • 15

1 Answers1

0

Found a way to achieve this:

# List out all the dependencies here
INTERMEDIATE_TARGET := \
lib_1
lib_2

generate.abc: $(INTERMEDIATE_TARGET) 
droid_dev
  • 303
  • 4
  • 15