# Makefile to build precompiled libraries, which cannot be built using standard NDK makefiles # TODO: libboost, libffmpeg, libpython (used only in GemRB) ARCHES32 := armeabi-v7a x86 ARCHES64 := arm64-v8a x86_64 ICONV := $(foreach ARCH, $(ARCHES32) $(ARCHES64), iconv/lib/$(ARCH)/libiconv.so iconv/lib/$(ARCH)/libcharset.so) ICU_LIBS := icudata icui18n icuio icutest icutu icuuc iculx icu-le-hb harfbuzz ICU := $(foreach ARCH, $(ARCHES32) $(ARCHES64), $(foreach NAME, $(ICU_LIBS), icuuc/lib/$(ARCH)/lib$(NAME).a)) OPENSSL := $(foreach ARCH, $(ARCHES32) $(ARCHES64), openssl/lib-$(ARCH)/libcrypto.so.sdl.1.so openssl/lib-$(ARCH)/libssl.so.sdl.1.so) LIBS := $(ICONV) $(ICU) $(OPENSSL) prebuilt-libraries: $(LIBS) .NOTPARALLEL: $(LIBS) $(ICONV) $(ICU): iconv/src/build.sh cd iconv/src && \ ./build.sh && \ for ARCH in $(ARCHES32) $(ARCHES64); do \ mkdir -p ../lib/$$ARCH ../include ; \ cp -f $$ARCH/libiconv.so $$ARCH/libcharset.so ../lib/$$ARCH/ ; \ cp -f $$ARCH/include/*.h ../include/ ; \ mkdir -p ../../icuuc/lib/$$ARCH ../../icuuc/include/unicode ../../icuuc/include/layout ; \ cp -f $$ARCH/libicu*.a $$ARCH/libharfbuzz.a ../../icuuc/lib/$$ARCH/ ; \ cp -f $$ARCH/include/unicode/*.h ../../icuuc/include/unicode/ ; \ cp -f $$ARCH/include/layout/*.h ../../icuuc/include/layout/ ; \ cp -f $$ARCH/include/icu-le-hb/layout/*.h ../../icuuc/include/layout/ ; \ done $(OPENSSL): openssl/compile.sh cd openssl && ./compile.sh iconv/src/build.sh openssl/compile.sh: git submodule update --init --recursive BOOST_LIBS := atomic chrono container context coroutine date_time exception filesystem \ graph iostreams log log_setup \ prg_exec_monitor program_options random regex serialization signals stacktrace_basic stacktrace_noop \ system test_exec_monitor thread timer type_erasure unit_test_framework wave wserialization # boost_math is broken on armeabi with NDK r16-beta2 toolchain # math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l BOOST := $(foreach ARCH, $(ARCHES32) $(ARCHES64), $(foreach NAME, $(BOOST_LIBS), boost/lib/$(ARCH)/libboost_$(NAME).a)) $(BOOST): rm -rf boost/include boost/lib ; \ cd boost/src && \ ./build-android.sh --boost=1.65.1 --arch=$(shell echo $(foreach ARCH, $(ARCHES32) $(ARCHES64),$(ARCH),) | tr -d ' ') && \ for ARCH in $(ARCHES32) $(ARCHES64); do \ mkdir -p ../lib/$$ARCH ../include ; \ $(foreach NAME, $(BOOST_LIBS), cp -f build/out/$$ARCH/lib/libboost_$(NAME)-clang-mt-1_65_1.a ../lib/$$ARCH/libboost_$(NAME).a || exit 1 ;) \ cp -r -f build/out/$$ARCH/include/boost-1_65_1/* ../include/ || exit 1 ; \ done || exit 1 ; \ $(foreach NAME, $(BOOST_LIBS), ln -sf boost ../../boost_$(NAME) ;) .PHONY: boost boost: $(BOOST)