<commit_before>all: CoreCrypto.cmxa

ifeq ($(OS),Windows_NT)
    CC = i686-w64-mingw32-gcc
    OPENSSL_INCLUDE = ../../../../openssl-1.0.1p/include
    OCAML_INCLUDE = /usr/local/lib/ocaml
else
    UNAME_S := $(shell uname -s)
    ifeq ($(UNAME_S),Darwin)
        CC = gcc-5
        OPENSSL_INCLUDE = /usr/include
        OCAML_INCLUDE = /usr/local/lib/ocaml
    else
        CC = gcc
        OPENSSL_INCLUDE = /usr/include/openssl
        OCAML_INCLUDE = /usr/lib/ocaml
    endif
endif

openssl_stub.o: openssl_stub.c
	ocamlopt -c -cc $(CC) -ccopt '-I $(OCAML_INCLUDE)' -ccopt "-I $(OPENSSL_INCLUDE)" -ccopt -fPIC -cclib -lcrypto -cclib -c $<
# haven't decided yet which style is better. It may interact slightly differently with flexlink.
#	ocamlopt -c -cc "$(CC) -I /usr/local/lib/ocaml -I ../../../../openssl-1.0.1p/include -lcrypto -c" $<
#	ocamlopt -c -cclib -lcrypto -cclib -lopenssl $< -ccopt -static

dllopenssl_wrap.so: openssl_stub.o
	ocamlmklib  -o  openssl_wrap  $<

CoreCrypto.cmi: CoreCrypto.mli
	ocamlc -I ../../Platform/ml -c CoreCrypto.mli

CoreCrypto.cmo: CoreCrypto.ml openssl.cmi<commit_msg>Passing -ccopt -fPIC only on Linux<commit_after>all: CoreCrypto.cmxa

ifeq ($(OS),Windows_NT)
    CC = i686-w64-mingw32-gcc
    OPENSSL_INCLUDE = ../../../../openssl-1.0.1p/include
    OCAML_INCLUDE = /usr/local/lib/ocaml
    EXTRA_OPTS =
else
    UNAME_S := $(shell uname -s)
    ifeq ($(UNAME_S),Darwin)
        CC = gcc-5
        OPENSSL_INCLUDE = /usr/include
        OCAML_INCLUDE = /usr/local/lib/ocaml
        EXTRA_OPTS =
    else
        CC = gcc
        OPENSSL_INCLUDE = /usr/include/openssl
        OCAML_INCLUDE = /usr/lib/ocaml
        EXTRA_OPTS = -ccopt -fPIC
    endif
endif

openssl_stub.o: openssl_stub.c
	ocamlopt -c -cc $(CC) -ccopt '-I $(OCAML_INCLUDE)' -ccopt "-I $(OPENSSL_INCLUDE)" $(EXTRA_OPTS) -cclib -lcrypto -cclib -c $<
# haven't decided yet which style is better. It may interact slightly differently with flexlink.
#	ocamlopt -c -cc "$(CC) -I /usr/local/lib/ocaml -I ../../../../openssl-1.0.1p/include -lcrypto -c" $<
#	ocamlopt -c -cclib -lcrypto -cclib -lopenssl $< -ccopt -static

dllopenssl_wrap.so: openssl_stub.o
	ocamlmklib  -o  openssl_wrap  $<

CoreCrypto.cmi: CoreCrypto.mli
	ocamlc -I ../../Platform/ml -c CoreCrypto.mli

CoreCrypto.cmo: CoreCrypto.ml openssl.cmi
{'fraction_non_alphanumeric': 0.14926660914581535, 'fraction_numerical': 0.012079378774805867, 'mean_word_length': 2.5953488372093023, 'pattern_counts': {'":': 0, '<': 11, '<?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': '752066', 'n_tokens_mistral': 995, 'n_tokens_neox': 900, 'n_words': 202}