<commit_before>UNAME_S := $(shell uname -s)
FLAGS=-O2 -fPIC -std=c99 -lm
.DEFAULT_GOAL := all

ifeq ($(UNAME_S),Linux)
    FLAGS += -D LINUX -lOpenCL -I/usr/lib/jvm/java-1.7.0-openjdk-amd64/include/
    TARGET_LIB=libgpu-matrix.so
    CC=gcc
endif
ifeq ($(UNAME_S),Darwin)
    FLAGS += -D DARWIN -framework opencl -I/System/Library/Frameworks/JavaVM.framework/Headers
    TARGET_LIB=libgpu-matrix.dylib
    CC=clang
endif

OUT_DIR=out
TARGET_FILE=${OUT_DIR}/main

OBJECT_FILES=ndarray.o utils/array.o utils/cl_helper.o utils/files.o \
	     utils/kernels.o
JNI_OBJECT_FILES=ndarray_jni.o initializer_jni.o

# Rules:

all: ${TARGET_FILE} 

libs: ${TARGET_LIB}

${TARGET_LIB}: ${OBJECT_FILES} ${JNI_OBJECT_FILES}
	${CC} $^ -o $@ ${FLAGS} -shared

clean:
	rm -rf ${OBJECT_FILES} ${JNI_OBJECT_FILES} \
	    *.so out/*<commit_msg>Add make install, which installs into resources/native/$OS/$ARCH/libgpu-matrix.$EXT<commit_after>UNAME_S := $(shell uname -s)
ARCH := $(shell uname -m)
FLAGS=-O2 -fPIC -std=c99 -lm
.DEFAULT_GOAL := all
OUT_DIR=out
TARGET_FILE=${OUT_DIR}/main

ifeq ($(UNAME_S),Linux)
    FLAGS += -D LINUX -lOpenCL -I/usr/lib/jvm/java-1.7.0-openjdk-amd64/include/
    TARGET_LIB=libgpu-matrix.so
    CC=gcc
    OS=linux
endif
ifeq ($(UNAME_S),Darwin)
    FLAGS += -D DARWIN -framework opencl -I/System/Library/Frameworks/JavaVM.framework/Headers
    TARGET_LIB=libgpu-matrix.dylib
    CC=clang
    OS=mac
endif

INSTALL_DIR=../../resources/native/${OS}/${ARCH}/
OBJECT_FILES=ndarray.o utils/array.o utils/cl_helper.o utils/files.o \
	     utils/kernels.o
JNI_OBJECT_FILES=ndarray_jni.o initializer_jni.o
INSTALL_LIB=${INSTALL_DIR}${TARGET_LIB}

# Rules:

all: ${TARGET_FILE} 

libs: ${TARGET_LIB}

install: ${INSTALL_DIR}
	cp ${TARGET_LIB} ${INSTALL_LIB}

uninstall: ${INSTALL_DIR}
	rm -rf ${INSTALL_LIB}

${TARGET_LIB}: ${OBJECT_FILES} ${JNI_OBJECT_FILES}
	${CC} $^ -o $@ ${FLAGS} -shared

clean:
	rm -rf ${OBJECT_FILES} ${JNI_OBJECT_FILES} \
	    *.so out/*
{'fraction_non_alphanumeric': 0.1626842907981698, 'fraction_numerical': 0.00813421453990849, 'mean_word_length': 4.111688311688312, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1833404', 'n_tokens_mistral': 849, 'n_tokens_neox': 794, 'n_words': 141}