<commit_before>default: release

.PHONY: default release debug all clean cppcheck doc

BOOST_PREFIX=$(HOME)/build/modular-boost/

DEBUG_TEST_EXE=debug/bin/test
RELEASE_TEST_EXE=release/bin/test

CC=clang++
LD=clang++

WARNING_FLAGS=-Wextra -Wall -Qunused-arguments -Wuninitialized -Wsometimes-uninitialized -Wno-long-long -Winit-self -Wdocumentation -pedantic
CXX_FLAGS=-Iinclude -std=c++1y -stdlib=libc++ $(WARNING_FLAGS) -isystem $(BOOST_PREFIX)/include
LD_FLAGS=$(CXX_FLAGS) -L $(BOOST_PREFIX)/lib -lboost_program_options
LD_TEST_FLAGS=$(LD_FLAGS) -lboost_unit_test_framework

DEBUG_FLAGS=-g
RELEASE_FLAGS=-g -DLOGGING_DISABLE -DNDEBUG -Ofast -march=native -fvectorize -fslp-vectorize-aggressive -fomit-frame-pointer
RELEASE_2_FLAGS=$(RELEASE_FLAGS) -fno-exceptions -fno-rtti

# Search the source files

SRC_CPP_FILES=$(wildcard src/*.cpp)
SRC_CPP_FILES_AST=$(wildcard src/ast/*.cpp)
SRC_CPP_FILES_ASM=$(wildcard src/asm/*.cpp)
SRC_CPP_FILES_LTAC=$(wildcard src/ltac/*.cpp)
SRC_CPP_FILES_MTAC=$(wildcard src/mtac/*.cpp)
SRC_CPP_FILES_LEXER=$(wildcard src/lexer/*.cpp)
SRC_CPP_FILES_PARSER=$(wildcard src/parser/*.cpp)

SRC_CPP_FILES_ALL=$(SRC_CPP_FILES) $(SRC_CPP_FILES_AST) $(SRC_CPP_FILES_ASM) $(SRC_CPP_FILES_LTAC) $(SRC_CPP_FILES_MTAC) $(SRC_CPP_FILES_LEXER) $(SRC_CPP_FILES_PARSER)

SRC_CPP_FILES_NON_EXEC := $(filter-out src/eddi.cpp,$(SRC_CPP_FILES_ALL))
SRC_CPP_FILES_NON_EXEC := $(filter-out src/parser/main.cpp,$(SRC_CPP_FILES_NON_EXEC))
SRC_CPP_FILES_NON_EXEC := $(filter-out src/lexer/main.cpp,$(SRC_CPP_FILES_NON_EXEC))

DEBUG_O_FILES_NON_EXEC=$(SRC_CPP_FILES_NON_EXEC:%.cpp=debug/%.cpp.o)
RELEASE_O_FILES_NON_EXEC=$(SRC_CPP_FILES_NON_EXEC:%.cpp=release/%.cpp.o)

TEST_CPP_FILES=$(wildcard test/*.cpp)

DEBUG_TEST_O_FILES_NON_EXEC=$(TEST_CPP_FILES:%.cpp=debug/%.cpp.o) $(DEBUG_O_FILES_NON_EXEC)
RELEASE_TEST_O_FILES_NON_EXEC=$(TEST_CPP_FILES:%.cpp=release/%.cpp.o) $(RELEASE_O_FILES_NON_EXEC)

CPP_FILES_ALL=$(SRC_CPP_FILES_ALL) $(TEST_CPP_FILES)

DEBUG_D_FILES=$(CPP_FILES_ALL:%.cpp=debug/%.cpp.d)
RELEASE_D_FILES=$(CPP_FILES_ALL:%.cpp=release/%.cpp.d)<commit_msg>Use LTO for release mode<commit_after>default: release

.PHONY: default release debug all clean cppcheck doc

BOOST_PREFIX=$(HOME)/build/modular-boost/

DEBUG_TEST_EXE=debug/bin/test
RELEASE_TEST_EXE=release/bin/test

CC=clang++
LD=clang++

WARNING_FLAGS=-Wextra -Wall -Qunused-arguments -Wuninitialized -Wsometimes-uninitialized -Wno-long-long -Winit-self -Wdocumentation -pedantic
CXX_FLAGS=-use-gold -Iinclude -std=c++1y -stdlib=libc++ $(WARNING_FLAGS) -isystem $(BOOST_PREFIX)/include
LD_FLAGS=$(CXX_FLAGS) -L $(BOOST_PREFIX)/lib -lboost_program_options
LD_TEST_FLAGS=$(LD_FLAGS) -lboost_unit_test_framework

DEBUG_FLAGS=-g
RELEASE_FLAGS=-g -DLOGGING_DISABLE -DNDEBUG -O3 -flto -march=native -fvectorize -fslp-vectorize-aggressive -fomit-frame-pointer
RELEASE_2_FLAGS=$(RELEASE_FLAGS) -fno-exceptions -fno-rtti

# Search the source files

SRC_CPP_FILES=$(wildcard src/*.cpp)
SRC_CPP_FILES_AST=$(wildcard src/ast/*.cpp)
SRC_CPP_FILES_ASM=$(wildcard src/asm/*.cpp)
SRC_CPP_FILES_LTAC=$(wildcard src/ltac/*.cpp)
SRC_CPP_FILES_MTAC=$(wildcard src/mtac/*.cpp)
SRC_CPP_FILES_LEXER=$(wildcard src/lexer/*.cpp)
SRC_CPP_FILES_PARSER=$(wildcard src/parser/*.cpp)

SRC_CPP_FILES_ALL=$(SRC_CPP_FILES) $(SRC_CPP_FILES_AST) $(SRC_CPP_FILES_ASM) $(SRC_CPP_FILES_LTAC) $(SRC_CPP_FILES_MTAC) $(SRC_CPP_FILES_LEXER) $(SRC_CPP_FILES_PARSER)

SRC_CPP_FILES_NON_EXEC := $(filter-out src/eddi.cpp,$(SRC_CPP_FILES_ALL))
SRC_CPP_FILES_NON_EXEC := $(filter-out src/parser/main.cpp,$(SRC_CPP_FILES_NON_EXEC))
SRC_CPP_FILES_NON_EXEC := $(filter-out src/lexer/main.cpp,$(SRC_CPP_FILES_NON_EXEC))

DEBUG_O_FILES_NON_EXEC=$(SRC_CPP_FILES_NON_EXEC:%.cpp=debug/%.cpp.o)
RELEASE_O_FILES_NON_EXEC=$(SRC_CPP_FILES_NON_EXEC:%.cpp=release/%.cpp.o)

TEST_CPP_FILES=$(wildcard test/*.cpp)

DEBUG_TEST_O_FILES_NON_EXEC=$(TEST_CPP_FILES:%.cpp=debug/%.cpp.o) $(DEBUG_O_FILES_NON_EXEC)
RELEASE_TEST_O_FILES_NON_EXEC=$(TEST_CPP_FILES:%.cpp=release/%.cpp.o) $(RELEASE_O_FILES_NON_EXEC)

CPP_FILES_ALL=$(SRC_CPP_FILES_ALL) $(TEST_CPP_FILES)

DEBUG_D_FILES=$(CPP_FILES_ALL:%.cpp=debug/%.cpp.d)
RELEASE_D_FILES=$(CPP_FILES_ALL:%.cpp=release/%.cpp.d)
{'fraction_non_alphanumeric': 0.14691829909221213, 'fraction_numerical': 0.0011944577161968467, 'mean_word_length': 8.387892376681615, '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': '2379167', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1661, 'n_words': 193}