There are many things in Android.mk especially jni's makefile.
here are some key information in the make file.
a. target name
what's the code's target name is defined in "LOCAL_MODULE"
for example
LOCAL_MODULE := libwebcore //webkit
LOCAL_MODULE:= libskia //skia
LOCAL_MODULE := ping//ping
b. what kind of will the target be?
there will be three results for c code, static library, share library and executable, how can we tell from the make file?
find "include" key words
include $(BUILD_SHARED_LIBRARY) //shared
include $(BUILD_EXECUTABLE) // executable
include $(BUILD_STATIC_LIBRARY) //static
c. where is ANDROID defined
for some multi-platform module, the platform macro is used. like "#ifdef ANDROID "
where is ANDROID definded?
build/config.mk
COMMON_GLOBAL_CFLAGS:= -DANDROID -fmessage-length=0 -W
-Wall -Wno-unused -Winit-self -Wpointer-arith
d. other global macro definition
other XX.mk in build directory
for example the "shared_library.mk" and "static_library.mk" we talked above
we just need to define the macro and include the XXX.mk.
e. webkit's platform related macro
external/webkit/JavaScriptCore/wtf/Platform.h
for example.
#ifdef ANDROID #define WTF_OS_ANDROID 1 #endif
#if PLATFORM(ANDROID) && !defined WTF_USE_ACCELERATED_COMPOSITING #define WTF_USE_ACCELERATED_COMPOSITING 1 #define ENABLE_3D_RENDERING 1 #endif
others
libmodle's address, sometimes error below will occur, as we are compiling a lib module.
" library 'lib*.so' not in prelink map"
solution:
1.build/core/prelink-linux-arm.map
add
lib*.so 0x9C300000
2.add LOCAL_PRELINK_MODULE := false
in Android.mk