<commit_before>
# Make sure this is always first.
.PHONY: default
default: all

-include local.mk

CXXFLAG = -Wall -Werror -g -O3
LINK.o = $(LINK.cc)

INCLUDE = -I.
LOCAL_LIBS = log/libcert.a log/libdatabase.a log/liblog.a \
             merkletree/libmerkletree.a \
             proto/libproto.a util/libutil.a
LDLIBS = -lpthread -lgflags -lglog -lssl -lcrypto \
         -lsqlite3 -lprotobuf -lcurl -lcppnetlib-uri

PLATFORM = $(shell uname -s)
ifneq ($(PLATFORM), FreeBSD)
  LDLIBS += -lresolv
endif

ifeq ($(PLATFORM), Darwin)
  LDLIBS += -lboost_system-mt
else
  LDLIBS += -lboost_system
endif

# Need OpenSSL >= 1.0.0
ifneq ($(OPENSSLDIR),)
  INCLUDE += -I $(OPENSSLDIR)/include
  LDLIBS += -L $(OPENSSLDIR) -L $(OPENSSLDIR)/lib -Wl,-rpath,$(OPENSSLDIR) \
            -Wl,-rpath,$(OPENSSLDIR)/lib
endif

# Allow non-system version of curl to be used.
# Useful if it was built with a custom OpenSSL version.
ifneq ($(CURLDIR),)
  INCLUDE += -I $(CURLDIR)/include
  LDLIBS += -L $(CURLDIR)/lib/.libs -Wl,-rpath,$(CURLDIR)/lib/.libs
endif

# Need cpp-netlib
ifneq ($(CPPNETLIBDIR),)
  INCLUDE += -I $(CPPNETLIBDIR)
  LDLIBS += -L $(CPPNETLIBDIR)/libs/network/src \
            -Wl,-rpath,$(CPPNETLIBDIR)/libs/network/src
endif

# Json library location explicitly specified - link against that.
ifneq ($(JSONCLIBDIR),)
	INCLUDE += -I $(JSONCLIBDIR)/include
	LDLIBS += -L $(JSONCLIBDIR)/lib -Wl,-rpath,$(JSONCLIBDIR)/lib -ljson-c
else
	CXXFLAG += $(shell pkg-config --cflags json-c)
	LDLIBS += $(shell pkg-config --libs json-c)
endif

# Need gtest
GTESTDIR ?= /usr/src/gtest
INCLUDE += -I $(GTESTDIR)/include

# Allow user-system overrides
INCLUDE += -I /usr/local/include
LDLIBS += -L /usr/local/lib

CXXFLAGS = $(INCLUDE) $(CXXFLAG) $(LOCAL_CXXFLAGS)

# File lists to simplify the rest of the Makefile

PROTO_TESTS = proto/serializer_test
MERKLETREE_TESTS = merkletree/merkle_tree_test \
                   merkletree/merkle_tree_large_test \
                   merkletree/serial_hasher_test merkletree/tree_hasher_test
LOG_TESTS = log/cert_test log/cert_checker_test \
            log/cert_submission_handler_test log/database_test \
            log/database_large_test log/file_storage_test \
            log/frontend_signer_test log/frontend_test log/log_lookup_test \
            log/signer_verifier_test log/log_signer_test log/tree_signer_test \
            log/logged_certificate_test log/ct_extensions_test
UTIL_TESTS = util/json_wrapper_test
MONITOR_TESTS = monitor/database_test
ALL_TESTS = $(PROTO_TESTS) $(MERKLETREE_TESTS) $(LOG_TESTS) $(UTIL_TESTS) \
	$(MONITOR_TESTS)

all: unit_tests client/ct server/ct-server server/blob-server \
     server/ct-rfc-server<commit_msg>Make variables set from shell commands simply expanded.<commit_after>
# Make sure this is always first.
.PHONY: default
default: all

-include local.mk

CXXFLAG = -Wall -Werror -g -O3
LINK.o = $(LINK.cc)

INCLUDE = -I .
LOCAL_LIBS = log/libcert.a log/libdatabase.a log/liblog.a \
             merkletree/libmerkletree.a \
             proto/libproto.a util/libutil.a
LDLIBS = -lpthread -lgflags -lglog -lssl -lcrypto \
         -lsqlite3 -lprotobuf -lcurl -lcppnetlib-uri

PLATFORM := $(shell uname -s)
ifneq ($(PLATFORM), FreeBSD)
  LDLIBS += -lresolv
endif

ifeq ($(PLATFORM), Darwin)
  LDLIBS += -lboost_system-mt
else
  LDLIBS += -lboost_system
endif

# Need OpenSSL >= 1.0.0
ifneq ($(OPENSSLDIR),)
  INCLUDE += -I $(OPENSSLDIR)/include
  LDLIBS += -L $(OPENSSLDIR) -L $(OPENSSLDIR)/lib -Wl,-rpath,$(OPENSSLDIR) \
            -Wl,-rpath,$(OPENSSLDIR)/lib
endif

# Allow non-system version of curl to be used.
# Useful if it was built with a custom OpenSSL version.
ifneq ($(CURLDIR),)
  INCLUDE += -I $(CURLDIR)/include
  LDLIBS += -L $(CURLDIR)/lib/.libs -Wl,-rpath,$(CURLDIR)/lib/.libs
endif

# Need cpp-netlib
ifneq ($(CPPNETLIBDIR),)
  INCLUDE += -I $(CPPNETLIBDIR)
  LDLIBS += -L $(CPPNETLIBDIR)/libs/network/src \
            -Wl,-rpath,$(CPPNETLIBDIR)/libs/network/src
endif

# Json library location explicitly specified - link against that.
ifneq ($(JSONCLIBDIR),)
	INCLUDE += -I $(JSONCLIBDIR)/include
	LDLIBS += -L $(JSONCLIBDIR)/lib -Wl,-rpath,$(JSONCLIBDIR)/lib -ljson-c
else
	JSON_C_CFLAGS := $(shell pkg-config --cflags json-c)
	CXXFLAG += $(JSON_C_CFLAGS)
	JSON_C_LIBS := $(shell pkg-config --libs json-c)
	LDLIBS += $(JSON_C_LIBS)
endif

# Need gtest
GTESTDIR ?= /usr/src/gtest
INCLUDE += -I $(GTESTDIR)/include

# Allow user-system overrides
INCLUDE += -I /usr/local/include
LDLIBS += -L /usr/local/lib

CXXFLAGS = $(INCLUDE) $(CXXFLAG) $(LOCAL_CXXFLAGS)

# File lists to simplify the rest of the Makefile

PROTO_TESTS = proto/serializer_test
MERKLETREE_TESTS = merkletree/merkle_tree_test \
                   merkletree/merkle_tree_large_test \
                   merkletree/serial_hasher_test merkletree/tree_hasher_test
LOG_TESTS = log/cert_test log/cert_checker_test \
            log/cert_submission_handler_test log/database_test \
            log/database_large_test log/file_storage_test \
            log/frontend_signer_test log/frontend_test log/log_lookup_test \
            log/signer_verifier_test log/log_signer_test log/tree_signer_test \
            log/logged_certificate_test log/ct_extensions_test
UTIL_TESTS = util/json_wrapper_test
MONITOR_TESTS = monitor/database_test
ALL_TESTS = $(PROTO_TESTS) $(MERKLETREE_TESTS) $(LOG_TESTS) $(UTIL_TESTS) \
	$(MONITOR_TESTS)

all: unit_tests client/ct server/ct-server server/blob-server \
     server/ct-rfc-server
{'fraction_non_alphanumeric': 0.12723295661684286, 'fraction_numerical': 0.0018228217280349982, 'mean_word_length': 3.38258785942492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2913416', 'n_tokens_mistral': 2102, 'n_tokens_neox': 2023, 'n_words': 432}