View difference between Paste ID: zMUSuhz7 and nYAWt65M
SHOW: | | - or go back to the newest paste.
1
# folder structure:
2
# - project
3
# -- src
4
# --- somefile.cpp
5
# --- somefile.h
6
# -- common
7
# --- utils
8
# ---- someutil.c
9
# ---- someutil.h
10
# -- android 
11
# --- jni
12
# ---- Android.mk
13
# ---- Application.mk
14
# 
15
# Command line:
16
# macbook:jni mreed$ ndk-build clean && ndk-build 
17
# Clean: gnustl_shared [armeabi]
18
# Clean: gnustl_static [armeabi]
19
# Clean: mur [armeabi]
20
# SharedLibrary  : libmur.so
21
# Install        : libmur.so => libs/armeabi/libmur.so
22
# 
23
# Android.mk:
24
25
LOCAL_PATH := $(call my-dir)
26
27
include $(CLEAR_VARS)
28
29
LOCAL_MODULE = mur
30
31
define compdir
32
SUBDIRS := $$(wildcard $(1)/*/)
33
LOCAL_C_INCLUDES += $(1)
34
LOCAL_SRC_FILES += \
35
	$$(wildcard $$(addsuffix *.cpp,$$(SUBDIRS))) \
36
	$$(wildcard $$(addsuffix *.c,$$(SUBDIRS)))
37
endef
38
39
# we want to add the source files from /project/src and /project/common
40
$(call compdir,../../src)
41
$(call compdir,../../common)
42
43
# updated variables should now look like:
44
# LOCAL_C_INCLUDES = ../../src ../../common
45
# LOCAL_SRC_FILES = ../../src/somefile.cpp ../../common/utils/someutil.c
46
47
LOCAL_C_INCLUDES += $(LOCAL_PATH)/curl/include
48
49
LOCAL_STATIC_LIBRARIES = libcurl
50
51
include $(BUILD_SHARED_LIBRARY)