View difference between Paste ID: 1k9khB4h and zMUSuhz7
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
# ignore the references to curl
25
26
LOCAL_PATH := $(call my-dir)
27
28
# include to make libcurl
29
#include curl/Android.mk
30
31
include $(CLEAR_VARS)
32
33
LOCAL_MODULE = mur
34
35
define compdir
36
SUBDIRS := $$(wildcard $(1)/*/)
37
LOCAL_C_INCLUDES += $(1)
38
LOCAL_SRC_FILES += \
39
	$$(wildcard $$(addsuffix *.cpp,$$(SUBDIRS))) \
40
	$$(wildcard $$(addsuffix *.c,$$(SUBDIRS)))
41
endef
42
43
# we want to add the source files from /project/src and /project/common
44
$(call compdir,../../src)
45
$(call compdir,../../common)
46
47
# updated variables should now look like:
48
# LOCAL_C_INCLUDES = ../../src ../../common
49
# LOCAL_SRC_FILES = ../../src/somefile.cpp ../../common/utils/someutil.c
50
51
LOCAL_C_INCLUDES += $(LOCAL_PATH)/curl/include
52
53
LOCAL_STATIC_LIBRARIES = libcurl
54
55
include $(BUILD_SHARED_LIBRARY)