<commit_before># This Makefile is heavily based on LevelDB's:
# https://code.google.com/p/leveldb/

#-----------------------------------------------
# Uncomment exactly one of the lines labelled (A), (B), and (C) below
# to switch between compilation modes.

OPT ?= -O2 -DNDEBUG       # (A) Production use (optimized mode)
# OPT ?= -g2              # (B) Debug mode, w/ full line-level debugging symbols
# OPT ?= -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols
#-----------------------------------------------

# Use default if no configuration specified.
CXX ?= g++
AR ?= ar

# Version number of lmctfy.
VERSION = "\"0.3.1\""

# TODO(vmarmol): Ensure our dependencies are installed
PROTOC = protoc

# Function for getting a set of source files.
get_srcs = $(shell find $(1) -name \*.cc -a ! -name \*_test.cc | tr "\n" " ")

INCLUDE_PROTOS = include/lmctfy
UTIL_PROTOS = util/task/codes
BASE_SOURCES = $(call get_srcs,base/)
FILE_SOURCES = $(call get_srcs,file/)
INCLUDE_SOURCES = $(call get_srcs,include/) \
		  $(addsuffix .pb.cc,$(INCLUDE_PROTOS))
UTIL_SOURCES = $(call get_srcs,util/) $(addsuffix .pb.cc,$(UTIL_PROTOS))
STRINGS_SOURCES = $(call get_srcs,strings/)
THREAD_SOURCES = $(call get_srcs,thread/)
LIBLMCTFY_SOURCES =$(shell find lmctfy/ -name \*.cc -a ! -name \*_test.cc \
		   -a ! -path \*cli/\* | tr "\n" " ")
CLI_SOURCES = $(call get_srcs,lmctfy/cli/)

# The objects for the system API (both release and test versions).
SYSTEM_API_OBJS = system_api/kernel_api.o \
		  system_api/kernel_api_singleton.o \
		  system_api/libc_fs_api_impl.o \
		  system_api/libc_fs_api_singleton.o
SYSTEM_API_TEST_OBJS = system_api/kernel_api.o \
		       system_api/kernel_api_test_util.o \
		       system_api/libc_fs_api_impl.o \
		       system_api/libc_fs_api_test_util.o

# Gets all *_test.cc files in lmtcfy/.
TESTS = $(basename $(shell find lmctfy/ -name \*_test.cc))

# Where to place the binary outputs.
OUT_DIR = bin

# Location of gTest and gMock.
GTEST_DIR = gmock/gtest
GMOCK_DIR = gmock

# TODO(vmarmol): Detect supported GCC and use c++0x or c++11.
CXXFLAGS += $(OPT) -std=c++0x

# Add defines.
CXXFLAGS += -DHASH_NAMESPACE=std -DHAVE_LONG_LONG -DGTEST_HAS_STRING_PIECE_ \
	    -DLMCTFY_VERSION=$(VERSION)

# Add libraries to link in.
CXXFLAGS += -pthread -lrt -lre2 -lgflags
<commit_msg>Fix building with gcc-4.7.2.<commit_after># This Makefile is heavily based on LevelDB's:
# https://code.google.com/p/leveldb/

#-----------------------------------------------
# Uncomment exactly one of the lines labelled (A), (B), and (C) below
# to switch between compilation modes.

OPT ?= -O2 -DNDEBUG       # (A) Production use (optimized mode)
# OPT ?= -g2              # (B) Debug mode, w/ full line-level debugging symbols
# OPT ?= -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols
#-----------------------------------------------

# Use default if no configuration specified.
CXX ?= g++
AR ?= ar

# Version number of lmctfy.
VERSION = "\"0.3.1\""

# TODO(vmarmol): Ensure our dependencies are installed
PROTOC = protoc

# Function for getting a set of source files.
get_srcs = $(shell find $(1) -name \*.cc -a ! -name \*_test.cc | tr "\n" " ")

INCLUDE_PROTOS = include/lmctfy
UTIL_PROTOS = util/task/codes
BASE_SOURCES = $(call get_srcs,base/)
FILE_SOURCES = $(call get_srcs,file/)
INCLUDE_SOURCES = $(call get_srcs,include/) \
		  $(addsuffix .pb.cc,$(INCLUDE_PROTOS))
UTIL_SOURCES = $(call get_srcs,util/) $(addsuffix .pb.cc,$(UTIL_PROTOS))
STRINGS_SOURCES = $(call get_srcs,strings/)
THREAD_SOURCES = $(call get_srcs,thread/)
LIBLMCTFY_SOURCES =$(shell find lmctfy/ -name \*.cc -a ! -name \*_test.cc \
		   -a ! -path \*cli/\* | tr "\n" " ")
CLI_SOURCES = $(call get_srcs,lmctfy/cli/)

# The objects for the system API (both release and test versions).
SYSTEM_API_OBJS = system_api/kernel_api.o \
		  system_api/kernel_api_singleton.o \
		  system_api/libc_fs_api_impl.o \
		  system_api/libc_fs_api_singleton.o
SYSTEM_API_TEST_OBJS = system_api/kernel_api.o \
		       system_api/kernel_api_test_util.o \
		       system_api/libc_fs_api_impl.o \
		       system_api/libc_fs_api_test_util.o

# Gets all *_test.cc files in lmtcfy/.
TESTS = $(basename $(shell find lmctfy/ -name \*_test.cc))

# Where to place the binary outputs.
OUT_DIR = bin

# Location of gTest and gMock.
GTEST_DIR = gmock/gtest
GMOCK_DIR = gmock

CXXFLAGS += $(OPT)

# Determine GCC version.
GCC_VERSION = $(shell $(CXX) -dumpversion | awk -F'.' \
	      '{printf "%d%02d%02d", $$1, $$2, $$3}')

# Helper comparison function.
IF = $(if $(shell [[ $(1) -$(2) $(3) ]] && echo "1"),$(4),$(5))

# Use c++11 for GCC >=4.7.0 and c++0x for earlier versions. Additionally,
# set -fpermissive for 4.7.x to work around '<::'.
CXXFLAGS += $(call IF,$(GCC_VERSION),ge,40700,\
	    $(call IF,$(GCC_VERSION),lt,40800,\
	    -std=c++11 -fpermissive,-std=c++11),\
	    -std=c++0x)

# Add defines.
CXXFLAGS += -DHASH_NAMESPACE=std -DHAVE_LONG_LONG -DGTEST_HAS_STRING_PIECE_ \
	    -DLMCTFY_VERSION=$(VERSION)

# Add libraries to link in.
CXXFLAGS += -pthread -lrt -lre2 -lgflags

{'fraction_non_alphanumeric': 0.17797443461160276, 'fraction_numerical': 0.011996066863323501, 'mean_word_length': 3.052589641434263, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '3149028', 'n_tokens_mistral': 1997, 'n_tokens_neox': 1838, 'n_words': 486}