diff --git a/arch/android/CONFIG.ANDROID b/arch/android/CONFIG.ANDROID index 8fd741e5d..70701eca0 100755 --- a/arch/android/CONFIG.ANDROID +++ b/arch/android/CONFIG.ANDROID @@ -2,5 +2,7 @@ # TODO: GL fixed renderers don't work. Probably not worth fixing. +[ -z "$NDK_PATH" ] && { echo "Must define NDK_PATH!"; exit 1; } + ./config.sh --platform android --enable-release --disable-utils \ --disable-libpng --disable-gl-fixed "$@" diff --git a/arch/android/Makefile.deps b/arch/android/Makefile.deps index 50bc61ec7..90a247ea3 100644 --- a/arch/android/Makefile.deps +++ b/arch/android/Makefile.deps @@ -22,6 +22,7 @@ SDL_VERSION ?= 2.28.2 LIBOGG_VERSION ?= 1.3.5 LIBVORBIS_VERSION ?= 1.3.7 WGET ?= wget +TAR ?= tar DEPS := arch/android/deps DEPS_BUILD := arch/android/deps/.build @@ -34,53 +35,59 @@ ifeq (${HOST},${HOST_WIN64}) NDK_BUILD := ${NDK_PATH}/ndk-build.cmd endif +ifneq (${V},1) +WGET := @${WGET} +TAR := @${TAR} +NDK_BUILD := @${NDK_BUILD} +endif + ${DEPS} ${JNI_INCLUDES}: $(if @{V},,@echo " MKDIR " $@) - @${MKDIR} -p $@ + ${MKDIR} -p $@ ifeq (${ANDROID_TARGET},) ${DEPS}/SDL2-${SDL_VERSION}: | ${DEPS} $(if ${V},,@echo " WGET " $@) - @${RM} -f $@.tar.gz - @${WGET} https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz -O$@.tar.gz - @tar -xzf $@.tar.gz -C ${DEPS}/ + ${RM} -f $@.tar.gz + ${WGET} https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz -O$@.tar.gz + ${TAR} -xzf $@.tar.gz -C ${DEPS}/ ${DEPS}/libogg-${LIBOGG_VERSION}: | ${DEPS} $(if ${V},,@echo " WGET " $@) - @${RM} -f $@.tar.gz - @${WGET} http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz -O$@.tar.gz - @tar -xzf $@.tar.gz -C ${DEPS}/ + ${RM} -f $@.tar.gz + ${WGET} http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz -O$@.tar.gz + ${TAR} -xzf $@.tar.gz -C ${DEPS}/ ${DEPS}/libvorbis-${LIBVORBIS_VERSION}: | ${DEPS} $(if ${V},,@echo " WGET " $@) - @${RM} -f $@.tar.gz - @${WGET} http://downloads.xiph.org/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz -O$@.tar.gz - @tar -xzf $@.tar.gz -C ${DEPS}/ + ${RM} -f $@.tar.gz + ${WGET} http://downloads.xiph.org/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz -O$@.tar.gz + ${TAR} -xzf $@.tar.gz -C ${DEPS}/ ${DEPS_BUILD}: $(if ${V},,@echo " MKDIR " $@) - @${MKDIR} -p ${DEPS_BUILD} + ${MKDIR} -p ${DEPS_BUILD} ${DEPS_BUILD}/libogg: ${DEPS}/libogg-${LIBOGG_VERSION} | ${DEPS_BUILD} - @${RM} -rf $@ - @${CP} -r $< $@ - @${CP} arch/android/libogg-Android.mk "$@/Android.mk" - @${CP} arch/android/config_types.h "$@/include/ogg/" + ${RM} -rf $@ + ${CP} -r $< $@ + ${CP} arch/android/libogg-Android.mk "$@/Android.mk" + ${CP} arch/android/config_types.h "$@/include/ogg/" ${DEPS_BUILD}/libvorbis: ${DEPS}/libvorbis-${LIBVORBIS_VERSION} | ${DEPS_BUILD} - @${RM} -rf $@ - @${CP} -r $< $@ - @${CP} arch/android/libvorbis-Android.mk "$@/Android.mk" + ${RM} -rf $@ + ${CP} -r $< $@ + ${CP} arch/android/libvorbis-Android.mk "$@/Android.mk" ${DEPS_BUILD}/SDL2: ${DEPS}/SDL2-${SDL_VERSION} | ${DEPS_BUILD} - @${RM} -rf $@ - @${CP} -r $< $@ + ${RM} -rf $@ + ${CP} -r $< $@ ${DEPS_BUILD}/out: ${DEPS_BUILD}/libogg ${DEPS_BUILD}/libvorbis ${DEPS_BUILD}/SDL2 - @${CP} ${JNI_DIR}/Android.mk ${DEPS_BUILD} + ${CP} ${JNI_DIR}/Android.mk ${DEPS_BUILD} $(if ${V},,@echo " NDKBUILD") - @${NDK_BUILD} \ + ${NDK_BUILD} \ NDK_PROJECT_PATH="${DEPS_BUILD}" \ NDK_LIBS_OUT="${DEPS_BUILD}/out" \ APP_BUILD_SCRIPT="${DEPS_BUILD}/Android.mk" \ @@ -96,35 +103,34 @@ dep_targets := \ ${JNI_INCLUDES}/ogg \ ${JNI_INCLUDES}/vorbis \ ${JNI_LIBS}/libSDL2.so \ - ${JNI_LIBS}/libhidapi.so \ ${JNI_LIBS}/libogg.so \ ${JNI_LIBS}/libvorbis.so \ ${JNI_LIBS}/libvorbisfile.so ${DEPS_BUILD}/out/${ABI}/%.so: - @test -s $@ || { echo "Missing $@! Aborting..."; exit 1; } + @test -f $@ || { echo "Missing $@! Aborting..."; exit 1; } ${JNI_LIBS}/%.so: ${DEPS_BUILD}/out/${ABI}/%.so | ${JNI_LIBS} $(if ${V},,@echo " CP " $< " " $@) - @${CP} $< $@ + ${CP} $< $@ ${JNI_INCLUDES}/SDL2: ${DEPS_BUILD}/SDL2 | ${JNI_INCLUDES} $(if ${V},,@echo " CP " "$