diff --git a/Makefile b/Makefile index 30285c5..36053ff 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ app_id := com.wownero.wownerujo .PHONY: f-droid-sign f-droid-clean \ build-external-libs use-prebuilt-external-libs \ -wownero +toolchain openssl boost wownero collect \ +clean-external-libs all: build-external-libs @@ -20,28 +21,30 @@ f-droid-clean: @rm -f $(apk_path)/$(app_id)_${app_version}-aligned.apk @rm -f $(apk_path)/$(app_id)_${app_version}-release.apk -build-external-libs: - script/build-external-libs/all.sh +build-external-libs: collect # faster build for testing f-droid release use-prebuilt-external-libs: script/build-external-libs/use-archive.sh -wownero: +clean-external-libs: + script/build-external-libs/clean.sh + +toolchain: + script/build-external-libs/prep-toolchain.sh + +openssl: toolchain + script/build-external-libs/pre-build-openssl.sh + script/build-external-libs/build-openssl.sh + script/build-external-libs/post-build-openssl.sh + +boost: toolchain + script/build-external-libs/pre-build-boost.sh + script/build-external-libs/build-boost.sh + +wownero: toolchain openssl boost script/build-external-libs/pre-build-wownero.sh - source script/build-external-libs/env.sh script/build-external-libs/build-wownero.sh -# script/build-external-libs/prep-toolchain.sh - -# script/build-external-libs/build-openssl.sh -# script/build-external-libs/post-build-openssl.sh - -# script/build-external-libs/build-boost.sh - -# script/build-external-libs/build-wownero.sh - -# script/build-external-libs/collect.sh -# script/build-external-libs/pre-build-openssl.sh -# script/build-external-libs/pre-build-boost.sh -# script/build-external-libs/pre-build-wownero.sh +collect: wownero + script/build-external-libs/collect.sh diff --git a/script/build-external-libs/build-boost.sh b/script/build-external-libs/build-boost.sh index 4873ebe..eeb0c9a 100755 --- a/script/build-external-libs/build-boost.sh +++ b/script/build-external-libs/build-boost.sh @@ -2,6 +2,8 @@ set -e +source script/build-external-libs/env.sh + build_root=$EXTERNAL_LIBS_BUILD_ROOT cd $build_root/boost_1_58_0 diff --git a/script/build-external-libs/build-openssl.sh b/script/build-external-libs/build-openssl.sh index 91ee8f4..c5123f1 100755 --- a/script/build-external-libs/build-openssl.sh +++ b/script/build-external-libs/build-openssl.sh @@ -2,6 +2,8 @@ set -e +source script/build-external-libs/env.sh + cd $EXTERNAL_LIBS_BUILD_ROOT cd android-openssl diff --git a/script/build-external-libs/build-wownero.sh b/script/build-external-libs/build-wownero.sh index 9e26e98..12865d3 100755 --- a/script/build-external-libs/build-wownero.sh +++ b/script/build-external-libs/build-wownero.sh @@ -2,6 +2,8 @@ set -e +source script/build-external-libs/env.sh + cd $EXTERNAL_LIBS_BUILD_ROOT cd wownero diff --git a/script/build-external-libs/build.sh b/script/build-external-libs/build.sh index 50d1701..d35400d 100755 --- a/script/build-external-libs/build.sh +++ b/script/build-external-libs/build.sh @@ -2,8 +2,6 @@ set -e -source script/build-external-libs/env.sh - script/build-external-libs/prep-toolchain.sh script/build-external-libs/build-openssl.sh diff --git a/script/build-external-libs/collect.sh b/script/build-external-libs/collect.sh index 0361bc4..fb41a05 100755 --- a/script/build-external-libs/collect.sh +++ b/script/build-external-libs/collect.sh @@ -2,6 +2,7 @@ set -e +source script/build-external-libs/env.sh cd external-libs diff --git a/script/build-external-libs/post-build-openssl.sh b/script/build-external-libs/post-build-openssl.sh index 3f2d1ca..59668b2 100755 --- a/script/build-external-libs/post-build-openssl.sh +++ b/script/build-external-libs/post-build-openssl.sh @@ -2,6 +2,8 @@ set -e +source script/build-external-libs/env.sh + build_root=$EXTERNAL_LIBS_BUILD_ROOT mkdir -p $build_root/build/openssl/{arm,arm64,x86,x86_64} diff --git a/script/build-external-libs/pre-build-boost.sh b/script/build-external-libs/pre-build-boost.sh index 58b00c9..7bfdee5 100755 --- a/script/build-external-libs/pre-build-boost.sh +++ b/script/build-external-libs/pre-build-boost.sh @@ -2,6 +2,10 @@ set -e +source script/build-external-libs/env.sh + cd $EXTERNAL_LIBS_BUILD_ROOT + +rm -rf boost_1_58_0 wget https://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz/download -O boost_1_58_0.tar.gz tar xfz boost_1_58_0.tar.gz diff --git a/script/build-external-libs/pre-build-openssl.sh b/script/build-external-libs/pre-build-openssl.sh index 0bde489..ad0c577 100755 --- a/script/build-external-libs/pre-build-openssl.sh +++ b/script/build-external-libs/pre-build-openssl.sh @@ -2,10 +2,13 @@ set -e +source script/build-external-libs/env.sh + cd $EXTERNAL_LIBS_BUILD_ROOT version="93e9e6" +rm -rf android-openssl git clone https://github.com/fuwa0529/android-openssl wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2l.tar.gz diff --git a/script/build-external-libs/pre-build-wownero.sh b/script/build-external-libs/pre-build-wownero.sh index 7fb6031..41903be 100755 --- a/script/build-external-libs/pre-build-wownero.sh +++ b/script/build-external-libs/pre-build-wownero.sh @@ -2,6 +2,8 @@ set -e +source script/build-external-libs/env.sh + cd $EXTERNAL_LIBS_BUILD_ROOT # version="618dea" diff --git a/script/build-external-libs/pre-build.sh b/script/build-external-libs/pre-build.sh index ed81fd7..80a3a3d 100755 --- a/script/build-external-libs/pre-build.sh +++ b/script/build-external-libs/pre-build.sh @@ -2,8 +2,6 @@ set -e -source script/build-external-libs/env.sh - script/build-external-libs/clean.sh script/build-external-libs/pre-build-openssl.sh diff --git a/script/build-external-libs/prep-toolchain.sh b/script/build-external-libs/prep-toolchain.sh index e188c0a..d6f00f2 100755 --- a/script/build-external-libs/prep-toolchain.sh +++ b/script/build-external-libs/prep-toolchain.sh @@ -2,22 +2,28 @@ set -e -echo "preparing $EXTERNAL_LIBS_BUILD_ROOT" +source script/build-external-libs/env.sh build_root=$EXTERNAL_LIBS_BUILD_ROOT PATH=$ANDROID_NDK_ROOT/build/tools/:$PATH -echo "installing arm" -make_standalone_toolchain.py --api 21 --stl=libc++ --arch arm --install-dir $build_root/tool/arm +if [ ! -d "$build_root/tool/arm" ]; then + echo "installing arm" + make_standalone_toolchain.py --api 21 --stl=libc++ --arch arm --install-dir $build_root/tool/arm +fi -echo "installing arm64" -make_standalone_toolchain.py --api 21 --stl=libc++ --arch arm64 --install-dir $build_root/tool/arm64 +if [ ! -d "$build_root/tool/arm64" ]; then + echo "installing arm64" + make_standalone_toolchain.py --api 21 --stl=libc++ --arch arm64 --install-dir $build_root/tool/arm64 +fi -echo "installing x86" -make_standalone_toolchain.py --api 21 --stl=libc++ --arch x86 --install-dir $build_root/tool/x86 +if [ ! -d "$build_root/tool/x86" ]; then + echo "installing x86" + make_standalone_toolchain.py --api 21 --stl=libc++ --arch x86 --install-dir $build_root/tool/x86 +fi -echo "installing x86_64" -make_standalone_toolchain.py --api 21 --stl=libc++ --arch x86_64 --install-dir $build_root/tool/x86_64 - -echo "done" +if [ ! -d "$build_root/tool/x86_64" ]; then + echo "installing x86_64" + make_standalone_toolchain.py --api 21 --stl=libc++ --arch x86_64 --install-dir $build_root/tool/x86_64 +fi