Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # folder structure:
- # - project
- # -- src
- # --- somefile.cpp
- # --- somefile.h
- # -- common
- # --- utils
- # ---- someutil.c
- # ---- someutil.h
- # -- android
- # --- jni
- # ---- Android.mk
- # ---- Application.mk
- #
- # Command line:
- # macbook:jni mreed$ ndk-build clean && ndk-build
- # Clean: gnustl_shared [armeabi]
- # Clean: gnustl_static [armeabi]
- # Clean: mur [armeabi]
- # SharedLibrary : libmur.so
- # Install : libmur.so => libs/armeabi/libmur.so
- #
- # Android.mk:
- LOCAL_PATH := $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_MODULE = mur
- define compdir
- SUBDIRS := $$(wildcard $(1)/*/)
- LOCAL_C_INCLUDES += $(1)
- LOCAL_SRC_FILES += \
- $$(wildcard $$(addsuffix *.cpp,$$(SUBDIRS))) \
- $$(wildcard $$(addsuffix *.c,$$(SUBDIRS)))
- endef
- # we want to add the source files from /project/src and /project/common
- $(call compdir,../../src)
- $(call compdir,../../common)
- # updated variables should now look like:
- # LOCAL_C_INCLUDES = ../../src ../../common
- # LOCAL_SRC_FILES = ../../src/somefile.cpp ../../common/utils/someutil.c
- LOCAL_C_INCLUDES += $(LOCAL_PATH)/curl/include
- LOCAL_STATIC_LIBRARIES = libcurl
- include $(BUILD_SHARED_LIBRARY)
Advertisement
Add Comment
Please, Sign In to add comment