I am trying to create a static library using the latest version of Android NDK (r5) and I have no luck. I managed to build and run samples (like HelloJni) without any problems, but starting a new project from scratch was a different story.
In this experiment, I am trying to create libpng. The structure of my folder is as follows:
root | +--- jni | +---- Android.mk ( one line: "include $(call all-subdir-makefiles)" ) | +---- png | +---- Android.mk ( see below ) | +---- { a bunch of .c and .h files )
So, I have two Android.mks. One for building all subprojects and one for libpng subproject. root / jni / png / Android.mk looks like this:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := png MODULE_PATH := $LOCAL_PATH LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.c) LOCAL_C_INCLUDES := $(wildcard $(LOCAL_PATH)/*.h) LOCAL_INTERMEDIATE_TARGETS += junk junk: echo $(LOCAL_SRC_FILES) include $(BUILD_STATIC_LIBRARY)
This installation installation does nothing (i.e. launching ndk-build from the root folder does nothing, even after building ndk-build). A detailed run (ndk-build V = 1) shows some rm -f calls (deleting nonexistent folders), but nothing is related to the project or subproject.
I am very interested why this build of the script fails, but the process should have been trivial, so I'm sure its nothing terribly interesting. I'm much more interested in how I can start attacking build errors myself. The echo call in the script never gets above - I have no idea how to determine which values โโor why it skips the subproject. Has anyone found a way to find out what the build system is trying to create?
I would also be interested to know if there are documents for these tools or if these are just a few text files in the Docs Docs folder? I tried to solve this problem by copying pieces of random Android.mk that I found from googling, but only a few commands used in simple NDK samples seem to be documented, so the experience really just raised new questions.
Dave
source share