<commit_before># Copyright (c) 2012 Turbulenz Limited.
# Released under "Modified BSD License".  See COPYING for full text.

############################################################

# /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolchains/llvm-3.3/prebuilt/darwin-x86_64/bin/clang
# -MMD -MP -MF ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o.d
# -gcc-toolchain /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
# -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes
# -target armv5te-none-linux-androideabi
# -march=armv5te
# -mtune=xscale
# -msoft-float
# -mthumb
# -marm
# -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing
# -O0 -UNDEBUG
# -fno-omit-frame-pointer -Ijni
# -DANDROID
# -Wa,--noexecstack -Wformat -Werror=format-security
# -I/Users/dtebbs/turbulenz/external/android/android-ndk-r9b/platforms/android-3/arch-arm/usr/include -c  jni/hello-jni.c -o ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o

# /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolchains/llvm-3.3/prebuilt/darwin-x86_64/bin/clang
# -MMD -MP -MF ./obj/local/armeabi-v7a/objs/helloneon/helloneon.o.d
# hains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
# -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes
# -gcc-toolchain /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolc
# -target armv7-none-linux-androideabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
# -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing
# -I/Users/dtebbs/turbulenz/external/android/android-ndk-r9b/sources//android/cpufeatures -Ijni -DANDROID -DHAVE_NEON=1 -Wa,--noexecstack -Wformat -Werror=format-security    -I/Users/dtebbs/turbulenz/external/android/android-ndk-r9b/platforms/android-4/arch-arm/usr/include -c  jni/helloneon.c -o ./obj/local/armeabi-v7a/objs/helloneon/helloneon.o

############################################################
# Util Functions
############################################################

# 1 - tzbuild arch (armv7a, x86, etc)
_android_arch_name = $(strip					\
  $(if $(filter armv5,$(1)),armeabi,			\
    $(if $(filter armv7a,$(1)),armeabi-v7a,		\
      $(1)										\
    )											\
  ))

############################################################

android_build_host := $(BUILDHOST)
ifeq (linux64,$(BUILDHOST))
  android_build_host := linux
endif
ifeq (linux32,$(BUILDHOST))
  android_build_host := linux
endif

# SDK dir

ANDROID_SDK_PATH ?= $(external_path)/android
ANDROID_SDK_TARGET ?= android-15
ANDROID_SDK_TARGET_NUM ?= 15
ANDROID_SDK_VERSION ?= 8
ANDROID_SDK ?= $(ANDROID_SDK_PATH)/android-sdk-$(android_build_host)

# NDK dir

ANDROID_NDK ?= $(ANDROID_SDK_PATH)/android-ndk-r9d
NDK_PLATFORM ?= android-9
NDK_GCC_VER ?= 4.8
NDK_CLANG_VER ?= 3.4
# NDK_HOSTOS ?= darwin
NDK_HOSTARCH ?= x86_64
NDK_STLPORT ?= 0
NDK_LIBCPP ?= 0
NDK_HAS_CLANGVER_IN_TOOLCHAIN_PATH ?= 0
NDK_HAS_UNIFIED_INCLUDES ?= 0

# Toolset for which arch

ANDROID_ARCH_NAME := $(call _android_arch_name,$(ARCH))

ifeq ($(ARCH),armv5)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/arm-linux-androideabi-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := arm-linux-androideabi-
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-arm
endif
ifeq ($(ARCH),armv7a)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/arm-linux-androideabi-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := arm-linux-androideabi-
  NDK_CLANG_FLAGS = -target armv7-none-linux-androideabi
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-arm
  NDK_USE_CLANG ?= 1
endif
ifeq ($(ARCH),x86)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/x86-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := i686-linux-android-
  NDK_CLANG_FLAGS = -target i686-none-linux-android
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-x86
  NDK_USE_CLANG ?= 1
endif
ifeq ($(NDK_ARCHDIR),)
  $(error Couldnt determine toolchain for android ARCH $(ARCH))
endif

# Find toolset for this platfom

ifeq ($(BUILDHOST),macosx)
  NDK_HOSTOS := darwin
endif
ifeq ($(BUILDHOST),linux64)
  NDK_HOSTOS := linux
endif
ifneq (,$(filter win%,$(BUILDHOST)))
  NDK_HOSTOS := windows
endif
ifeq ($(NDK_HOSTOS),)
  $(error Couldnt find toolchain for BUILDHOST $(BUILDHOST))
endif

NDK_TOOLCHAIN = $(NDK_ARCHDIR)/prebuilt/$(NDK_HOSTOS)-$(NDK_HOSTARCH)
NDK_TOOLBIN = $(NDK_TOOLCHAIN)/bin

ifeq (0,$(NDK_HAS_CLANGVER_IN_TOOLCHAIN_PATH))
  NDK_CLANG_TOOLCHAIN = \
   $(ANDROID_NDK)/toolchains/llvm/prebuilt/$(NDK_HOSTOS)-$(NDK_HOSTARCH)
else
  NDK_CLANG_TOOLCHAIN = \
   $(ANDROID_NDK)/toolchains/llvm-$(NDK_CLANG_VER)/prebuilt/$(NDK_HOSTOS)-$(NDK_HOSTARCH)
endif<commit_msg>blind attempt at arm64 suport<commit_after># Copyright (c) 2012 Turbulenz Limited.
# Released under "Modified BSD License".  See COPYING for full text.

############################################################

# /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolchains/llvm-3.3/prebuilt/darwin-x86_64/bin/clang
# -MMD -MP -MF ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o.d
# -gcc-toolchain /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
# -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes
# -target armv5te-none-linux-androideabi
# -march=armv5te
# -mtune=xscale
# -msoft-float
# -mthumb
# -marm
# -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing
# -O0 -UNDEBUG
# -fno-omit-frame-pointer -Ijni
# -DANDROID
# -Wa,--noexecstack -Wformat -Werror=format-security
# -I/Users/dtebbs/turbulenz/external/android/android-ndk-r9b/platforms/android-3/arch-arm/usr/include -c  jni/hello-jni.c -o ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o

# /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolchains/llvm-3.3/prebuilt/darwin-x86_64/bin/clang
# -MMD -MP -MF ./obj/local/armeabi-v7a/objs/helloneon/helloneon.o.d
# hains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
# -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes
# -gcc-toolchain /Users/dtebbs/turbulenz/external/android/android-ndk-r9b/toolc
# -target armv7-none-linux-androideabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
# -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing
# -I/Users/dtebbs/turbulenz/external/android/android-ndk-r9b/sources//android/cpufeatures -Ijni -DANDROID -DHAVE_NEON=1 -Wa,--noexecstack -Wformat -Werror=format-security    -I/Users/dtebbs/turbulenz/external/android/android-ndk-r9b/platforms/android-4/arch-arm/usr/include -c  jni/helloneon.c -o ./obj/local/armeabi-v7a/objs/helloneon/helloneon.o

############################################################
# Util Functions
############################################################

# 1 - tzbuild arch (armv7a, x86, etc)
_android_arch_name = $(strip                   \
  $(if $(filter armv5,$(1)),armeabi,           \
    $(if $(filter armv7a,$(1)),armeabi-v7a,    \
      $(if $(filter arm64,$(1)),arm64-v8a,     \
        $(1)                                   \
      )                                        \
    )                                          \
  ))

############################################################

android_build_host := $(BUILDHOST)
ifeq (linux64,$(BUILDHOST))
  android_build_host := linux
endif
ifeq (linux32,$(BUILDHOST))
  android_build_host := linux
endif

# SDK dir

ANDROID_SDK_PATH ?= $(external_path)/android
ANDROID_SDK_TARGET ?= android-15
ANDROID_SDK_TARGET_NUM ?= 15
ANDROID_SDK_VERSION ?= 8
ANDROID_SDK ?= $(ANDROID_SDK_PATH)/android-sdk-$(android_build_host)

# NDK dir

ANDROID_NDK ?= $(ANDROID_SDK_PATH)/android-ndk-r9d
NDK_PLATFORM ?= android-9
NDK_GCC_VER ?= 4.8
NDK_CLANG_VER ?= 3.4
# NDK_HOSTOS ?= darwin
NDK_HOSTARCH ?= x86_64
NDK_STLPORT ?= 0
NDK_LIBCPP ?= 0
NDK_HAS_CLANGVER_IN_TOOLCHAIN_PATH ?= 0
NDK_HAS_UNIFIED_INCLUDES ?= 0

# Toolset for which arch

ANDROID_ARCH_NAME := $(call _android_arch_name,$(ARCH))

ifeq ($(ARCH),armv5)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/arm-linux-androideabi-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := arm-linux-androideabi-
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-arm
endif
ifeq ($(ARCH),armv7a)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/arm-linux-androideabi-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := arm-linux-androideabi-
  NDK_CLANG_FLAGS = -target armv7-none-linux-androideabi
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-arm
  NDK_USE_CLANG ?= 1
endif
ifeq ($(ARCH),x86)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/x86-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := i686-linux-android-
  NDK_CLANG_FLAGS = -target i686-none-linux-android
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-x86
  NDK_USE_CLANG ?= 1
endif
ifeq ($(ARCH),arm64)
  NDK_ARCHDIR = $(ANDROID_NDK)/toolchains/aarch64-linux-android-$(NDK_GCC_VER)
  NDK_TOOLPREFIX := aarch64-linux-android
  NDK_CLANG_FLAGS = -target aarch64-linux-android
  NDK_PLATFORMDIR = \
    $(ANDROID_NDK)/platforms/$(NDK_PLATFORM)/arch-arm64
  NDK_USE_CLANG ?= 1
endif
ifeq ($(NDK_ARCHDIR),)
  $(error Couldnt determine toolchain for android ARCH $(ARCH))
endif

# Find toolset for this platfom

ifeq ($(BUILDHOST),macosx)
  NDK_HOSTOS := darwin
endif
ifeq ($(BUILDHOST),linux64)
  NDK_HOSTOS := linux
endif
ifneq (,$(filter win%,$(BUILDHOST)))
  NDK_HOSTOS := windows
endif
ifeq ($(NDK_HOSTOS),)
  $(error Couldnt find toolchain for BUILDHOST $(BUILDHOST))
endif

NDK_TOOLCHAIN = $(NDK_ARCHDIR)/prebuilt/$(NDK_HOSTOS)-$(NDK_HOSTARCH)
NDK_TOOLBIN = $(NDK_TOOLCHAIN)/bin

ifeq (0,$(NDK_HAS_CLANGVER_IN_TOOLCHAIN_PATH))
  NDK_CLANG_TOOLCHAIN = \
   $(ANDROID_NDK)/toolchains/llvm/prebuilt/$(NDK_HOSTOS)-$(NDK_HOSTARCH)
else
  NDK_CLANG_TOOLCHAIN = \
   $(ANDROID_NDK)/toolchains/llvm-$(NDK_CLANG_VER)/prebuilt/$(NDK_HOSTOS)-$(NDK_HOSTARCH)
endif
{'fraction_non_alphanumeric': 0.18865822784810127, 'fraction_numerical': 0.022379746835443037, 'mean_word_length': 4.444321940463065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6231567', 'n_tokens_mistral': 4303, 'n_tokens_neox': 4059, 'n_words': 520}