David 'Digit' Turner | f68d6af | 2010-07-09 09:56:31 -0700 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | # Define BUILD_FOO=1 to rebuild libfoo.so from scratch, then |
| 4 | # copy obj/local/armeabi/libfoo.so to jni/libfoo.so |
| 5 | # |
| 6 | ifneq ($(BUILD_FOO),) |
| 7 | |
| 8 | include $(CLEAR_VARS) |
| 9 | LOCAL_MODULE := foo |
| 10 | LOCAL_SRC_FILES := foo/foo.c |
| 11 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/foo |
| 12 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo |
| 13 | include $(BUILD_SHARED_LIBRARY) |
| 14 | |
| 15 | else # not build libfoo.so, trying to use PREBUILT_SHARED_LIBRARY instead. |
| 16 | |
| 17 | # Note: the module is named foo-prebuilt, but the library is libfool.so ! |
| 18 | # |
| 19 | include $(CLEAR_VARS) |
| 20 | LOCAL_MODULE := foo-prebuilt |
David 'Digit' Turner | 2068cc3 | 2010-09-22 15:11:57 +0200 | [diff] [blame] | 21 | LOCAL_SRC_FILES := libfoo.so |
David 'Digit' Turner | f68d6af | 2010-07-09 09:56:31 -0700 | [diff] [blame] | 22 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo |
| 23 | include $(PREBUILT_SHARED_LIBRARY) |
| 24 | |
| 25 | include $(CLEAR_VARS) |
| 26 | LOCAL_MODULE := foo-user |
| 27 | LOCAL_SRC_FILES := foo-user.c |
David 'Digit' Turner | 2068cc3 | 2010-09-22 15:11:57 +0200 | [diff] [blame] | 28 | LOCAL_SHARED_LIBRARIES := foo-prebuilt |
David 'Digit' Turner | f68d6af | 2010-07-09 09:56:31 -0700 | [diff] [blame] | 29 | include $(BUILD_SHARED_LIBRARY) |
| 30 | |
| 31 | endif |