<commit_before>.PHONY: clean coverage develop env extras package release test virtualenv

USE_CLANG = 1

UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S), Darwin)
	# Using clang for binary compatibility with boost.
	# CC = g++-4.8
	USE_CLANG = 1
else
	USE_CLANG = 0
endif

ifeq ($(USE_CLANG), 1)
	CC = clang++
else
	CC = g++
endif

PYENV = . env/bin/activate;
PYTHON = $(PYENV) python
EXTRAS_REQS := $(wildcard requirements-*.txt)
DISTRIBUTE = sdist bdist_wheel

SRC_ROOT = phraser
BIN_DIR = bin
BUILD_ROOT = $(shell $(PYTHON) ./scripts/get_build_dir.py)
BUILD_DIR = $(BUILD_ROOT)/$(SRC_ROOT)
TEST_FILE = tests/data/50k_comments.txt

COMMON_FLAGS = \
	-std=c++11 \
	-O3 \
	-I$(SRC_ROOT) \
	-Wpedantic \
	-Wall \
	-Wextra \
	-Werror \
	-Wno-c++98-compat-pedantic \
	-Wno-covered-switch-default \
	-Wno-padded \
	-Wno-unknown-pragmas \

COMMON_LAPOS_FLAGS = \
	-Wno-sign-conversion \
	-Wno-old-style-cast \
	-Wno-sign-compare \
	-Wno-float-equal \
	-Wno-unused-variable \
	-Wno-unused-parameter \
	-Wno-unused-function \

CLANG_FLAGS = \
	-Weverything \
	-fcolor-diagnostics \
	-ferror-limit=5 \
	-Wno-weak-vtables \
	-Wno-global-constructors \

CLANG_LAPOS_FLAGS = \
	-Wno-exit-time-destructors \
	-Wno-shorten-64-to-32 \

CC_FLAGS = $(COMMON_FLAGS) $(COMMON_LAPOS_FLAGS)

ifeq ($(USE_CLANG), 1)
	$(CC_FLAGS) = $(CC_FLAGS) $(CLANG_FLAGS) $(CLANG_LAPOS_FLAGS)
endif

LD_FLAGS = -lboost_regex

package: env
	$(PYTHON) setup.py $(DISTRIBUTE)

release: env
	$(PYTHON) setup.py $(DISTRIBUTE) upload -r livefyre

# if in local dev on Mac, `make coverage` will run tests and open
# coverage report in the browser
ifeq ($(shell uname -s), Darwin)
coverage: test
	open cover/index.html
endif
<commit_msg>Flags stuff.<commit_after>.PHONY: clean coverage develop env extras package release test virtualenv

OVERRIDE_USE_CLANG = 1

UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S), Darwin)
	# Using clang for binary compatibility with boost.
	# CC = g++-4.8
	USE_CLANG = 1
else
	ifeq ($(OVERRIDE_USE_CLANG), 1)
		USE_CLANG = 1
	else
		USE_CLANG = 0
	endif
endif

ifeq ($(USE_CLANG), 1)
	CC = clang++
else
	CC = g++
endif

PYENV = . env/bin/activate;
PYTHON = $(PYENV) python
EXTRAS_REQS := $(wildcard requirements-*.txt)
DISTRIBUTE = sdist bdist_wheel

SRC_ROOT = phraser
BIN_DIR = bin
BUILD_ROOT = $(shell $(PYTHON) ./scripts/get_build_dir.py)
BUILD_DIR = $(BUILD_ROOT)/$(SRC_ROOT)
TEST_FILE = tests/data/50k_comments.txt

COMMON_FLAGS = \
	-std=c++11 \
	-O3 \
	-I$(SRC_ROOT) \
	-Wall \
	-Wextra \
	-Wno-c++98-compat-pedantic \
	-Wno-covered-switch-default \
	-Wno-padded \
	-Wno-unknown-pragmas \

COMMON_LAPOS_FLAGS = \
	-Wno-sign-conversion \
	-Wno-old-style-cast \
	-Wno-sign-compare \
	-Wno-float-equal \
	-Wno-unused-variable \
	-Wno-unused-parameter \
	-Wno-unused-function \

CLANG_FLAGS = \
	-Werror \
	-Wpedantic \
	-Weverything \
	-fcolor-diagnostics \
	-ferror-limit=5 \
	-Wno-weak-vtables \
	-Wno-global-constructors \
	-Wno-implicit-fallthrough \

CLANG_LAPOS_FLAGS = \
	-Wno-exit-time-destructors \
	-Wno-shorten-64-to-32 \

ifeq ($(USE_CLANG), 1)
	CC_FLAGS = $(COMMON_FLAGS) $(COMMON_LAPOS_FLAGS) $(CLANG_FLAGS) $(CLANG_LAPOS_FLAGS)
else
	CC_FLAGS = $(COMMON_FLAGS) $(COMMON_LAPOS_FLAGS)
endif

LD_FLAGS = -lboost_regex

package: env
	$(PYTHON) setup.py $(DISTRIBUTE)

release: env
	$(PYTHON) setup.py $(DISTRIBUTE) upload -r livefyre

# if in local dev on Mac, `make coverage` will run tests and open
# coverage report in the browser
ifeq ($(shell uname -s), Darwin)
coverage: test
	open cover/index.html
endif

{'fraction_non_alphanumeric': 0.14367160775370583, 'fraction_numerical': 0.011402508551881414, 'mean_word_length': 3.557142857142857, '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': '2662031', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1482, 'n_words': 309}