I need to create a library with ar
from several object files that are built from sources included in LOCAL_SRC_FILES
and then link against it when building the final library.
Is this possible, and if yes - how can I do it?
I looked int substituting BUILD_SHARED_LIBRARY
with its expanded variant, but the rabbit hole goes way too deep (i.e. I'm not yet that desperate).
The reason I want to do this is because I've hacked together several small libraries into one and trying to build it as a whole. I know separating them in different modules built as stat with their own Android.mk files is a much better solution, but I'm quite short on time.
EDIT: The premise of the question is no longer valid as I had forgotten to add the source files of some of the libraries to the Android.mk
file, and had only added the files of the main library. At the same time I had added the dependencies' headers to LOCAL_C_INCLUDES
, and this way they had become link-time dependencies rather than compile-time as I intended them to be. Thus I don't actually need to build a library between compilation and linkage.
The rephrased question:
Is it possible, and if yes, how, to add a custom build step to an Android.mk file that is executed after compilation of source files but before linking them together into the final library/executable?