#!/bin/bash

rm ../agents/iguana *.o
if [[ $# -eq 0 ]]; then
    git pull
fi

echo "Compiling libsecp256k1.a ..."
cd secp256k1; ./m_android; cd ..

#$CC2 -o ../agents/iguana -O2 *.c ../basilisk/*.c  -I $NDK/platforms/android-19/arch-arm/usr/include ../agents/libcrypto777.a ../agents/libsecp256k1.a ../OSlibs/android/lib/libcurl.a -lssl -lcrypto -lm -lc -lz

echo "Compiling iguana ... "
#$CC2 -o ../agents/iguana -O2 *.c ../basilisk/basilisk.c ../gecko/gecko.c ../datachain/datachain.c -I ./secp256k1/include -I $NDK/platforms/android-21/arch-arm/usr/include ../agents/libcrypto777.a ../agents/libsecp256k1.a  ../OSlibs/android/lib/libcurl.a -L../OSlibs/android/lib/ -lssl -lcrypto -L$NDK/platforms/android-21/arch-arm/usr/lib -lm -lc -lz -nostdlib -lgcc

$CC2 -g -Wno-deprecated -c -O2 -DLIQUIDITY_PROVIDER=1 *.c ../basilisk/basilisk.c ../gecko/gecko.c ../datachain/datachain.c 
$CC2 -g -Wno-deprecated -c -DLIQUIDITY_PROVIDER=1 main.c iguana777.c iguana_bundles.c ../basilisk/basilisk.c
$CC2 -g -o ../agents/iguana -O2 *.o ../agents/libcrypto777.a ../OSlibs/android/lib/libcurl.a -L../OSlibs/android/lib/ -lcurl -lssl -lcrypto -lm