1 LOCAL_PATH := $(call my-dir) 2 3 include $(CLEAR_VARS) 4 LOCAL_MODULE := foo 5 LOCAL_SRC_FILES := foo.c foo2.c 6 include $(BUILD_STATIC_LIBRARY) 7 8 # The GNU linker will strip un-needed object files from executables even whe 9 # --whole-archive is used. However, it won't do it for shared libraries, so 10 # create an intermediate one, called 'bar' that includes 'foo' as a whole 11 # static library. 12 include $(CLEAR_VARS) 13 LOCAL_MODULE := bar 14 LOCAL_WHOLE_STATIC_LIBRARIES := foo 15 include $(BUILD_SHARED_LIBRARY) 16 17 include $(CLEAR_VARS) 18 LOCAL_MODULE := test_whole_static_libs 19 LOCAL_SRC_FILES := main.c 20 LOCAL_LDLIBS := -ldl 21 include $(BUILD_EXECUTABLE) 22