-
Notifications
You must be signed in to change notification settings - Fork 178
/
Android.mk
37 lines (28 loc) · 1.31 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
########################################################################
# Download/copy[/append?] this file to 'jni[/Android.mk]' directory of
# the *target* application. If https://github.com/supranational/blst is
# not configured as a submodule, the repository will be cloned into the
# 'jni' directory. Either way, it would be appropriate to add following
# lines to your .gitignore:
#
# [app/]jni/blst*
# [app/]src/supranational/blst
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := blst
LOCAL_SRC_FILES := blst/src/server.c blst/build/assembly.S blst_wrap.cpp
$(LOCAL_PATH)/blst:
@(cd `dirname $@` && \
mod=`git submodule 2>/dev/null | \
awk '{ if(match($$2,"/blst$$")) print $$2 }'` && \
[ -n "$$mod" ] && ln -s "$$mod" blst \
) || git clone https://github.com/supranational/blst.git $@
$(LOCAL_PATH)/blst/src/server.c $(LOCAL_PATH)/blst/build/assembly.S: $(LOCAL_PATH)/blst
$(LOCAL_PATH)/blst_wrap.cpp: $(LOCAL_PATH)/blst/bindings/blst.swg
blst_classes=`dirname $@`/../src/supranational/blst && \
mkdir -p $$blst_classes && \
swig -c++ -java -package supranational.blst -outdir $$blst_classes -o $@ $<
LOCAL_CFLAGS := -fno-builtin-memcpy -fvisibility=hidden
LOCAL_CPPFLAGS := -fexceptions -I$(LOCAL_PATH)/blst/bindings
LOCAL_LDFLAGS := -Wl,-Bsymbolic
include $(BUILD_SHARED_LIBRARY)