This repository was archived by the owner on Jun 14, 2024. It is now read-only.
forked from microsoft/cpprestsdk
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (53 loc) · 2.2 KB
/
Makefile
File metadata and controls
60 lines (53 loc) · 2.2 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SHELL := /bin/bash
OPENSSL_VER = openssl-1.0.2k
all: armeabi-v7a/lib/libssl.a x86/lib/libssl.a
clean:
rm -rf $(OPENSSL_VER)
rm -rf $(OPENSSL_VER)-armeabi-v7a
rm -rf armeabi-v7a
rm -rf setenv-android-x86.sh
setenv-android.sh:
wget https://wiki.openssl.org/images/7/70/Setenv-android.sh
mv Setenv-android.sh setenv-android.sh
chmod a+x setenv-android.sh
setenv-android-x86.sh: setenv-android.sh
cp setenv-android.sh setenv-android-x86.sh.tmp
sed -i -e 's/_ANDROID_EABI="arm-linux-androideabi-4.8"/_ANDROID_EABI="x86-4.8"/g' setenv-android-x86.sh.tmp
sed -i -e 's/_ANDROID_ARCH=arch-arm/_ANDROID_ARCH=arch-x86/g' setenv-android-x86.sh.tmp
mv setenv-android-x86.sh.tmp setenv-android-x86.sh
$(OPENSSL_VER).tar.gz:
wget https://www.openssl.org/source/$(OPENSSL_VER).tar.gz
armeabi-v7a/lib/libssl.a: setenv-android.sh $(OPENSSL_VER).tar.gz
[ -d "$(ANDROID_NDK_ROOT)" ]
export ANDROID_NDK_ROOT="$(ANDROID_NDK_ROOT)"; \
. ./setenv-android.sh; \
( \
set -e; \
rm -rf $(OPENSSL_VER)/; \
tar xzf $(OPENSSL_VER).tar.gz; \
rm -rf $(OPENSSL_VER)-armeabi-v7a/ \
) && \
mv $(OPENSSL_VER) $(OPENSSL_VER)-armeabi-v7a && \
cd $(OPENSSL_VER)-armeabi-v7a && \
perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org && \
./config shared -no-ssl2 -no-ssl3 -no-comp -no-hw -no-engine --openssldir="`pwd`/../armeabi-v7a" && \
make depend && \
make all && \
make install CC=$${ANDROID_TOOLCHAIN}/arm-linux-androideabi-gcc RANLIB=$${ANDROID_TOOLCHAIN}/arm-linux-androideabi-ranlib
x86/lib/libssl.a: setenv-android-x86.sh $(OPENSSL_VER).tar.gz
[ -d "$(ANDROID_NDK_ROOT)" ]
export ANDROID_NDK_ROOT="$(ANDROID_NDK_ROOT)"; \
. ./setenv-android-x86.sh; \
( \
set -e; \
rm -rf $(OPENSSL_VER)/; \
tar xzf $(OPENSSL_VER).tar.gz; \
rm -rf $(OPENSSL_VER)-x86/ \
) && \
mv $(OPENSSL_VER) $(OPENSSL_VER)-x86 && \
cd $(OPENSSL_VER)-x86 && \
perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org && \
./config shared -no-ssl2 -no-ssl3 -no-comp -no-hw -no-engine --openssldir="`pwd`/../x86" && \
make depend && \
make all && \
make install CC=$${ANDROID_TOOLCHAIN}/i686-linux-android-gcc RANLIB=$${ANDROID_TOOLCHAIN}/i686-linux-android-ranlib