<commit_before>SRC      := ${shell find ./src -name *.cc}
TEST_SRC := ${shell find ./test -name *.cc}
OBJ      := ${SRC:.cc=.o}
TEST_OBJ := test/_test.o test/encoding_test.o test/message_test.o \
            src/message.o src/peer.o
INCL     := ${shell find ./include}

CXXFLAGS = -std=c++14 -I./src -I./include -fPIC
LD_FLAGS = -L./build -lpthread

all: prepare build/failure-detector build/test

src/%.o: src/%.cc $(INCL)
	$(CXX) $(CXXFLAGS) -std=c++14 -fPIC -c -o $@ $<

test/%.o: test/%.cc $(INCL)
	$(CXX) $(CXXFLAGS) -std=c++14 -fPIC -c -o $@ $<

build/failure-detector: prepare $(OBJ)
	$(CXX) -fPIC -o $@ $(OBJ)

build/test: $(TEST_OBJ)
	$(CXX) -o $@ $(TEST_OBJ) $(LD_FLAGS)

prepare:
	mkdir -p build

clean:
	rm -rf ./build
	rm src/*.o
	rm test/*.o

test: prepare build/test
	LD_LIBRARY_PATH=./build ./build/test

valgrind_test: build/test
	LD_LIBRARY_PATH=./build valgrind ./build/test

.PHONY: prepare clean test valgrind_test<commit_msg>fix build by linking pthread<commit_after>SRC      := ${shell find ./src -name *.cc}
TEST_SRC := ${shell find ./test -name *.cc}
OBJ      := ${SRC:.cc=.o}
TEST_OBJ := test/_test.o test/encoding_test.o test/message_test.o \
            src/message.o src/peer.o
INCL     := ${shell find ./include}

CXXFLAGS = -std=c++14 -I./src -I./include -fPIC
LD_FLAGS = -L./build -lpthread

all: prepare build/failure-detector build/test

src/%.o: src/%.cc $(INCL)
	$(CXX) $(CXXFLAGS) -std=c++14 -fPIC -c -o $@ $<

test/%.o: test/%.cc $(INCL)
	$(CXX) $(CXXFLAGS) -std=c++14 -fPIC -c -o $@ $<

build/failure-detector: prepare $(OBJ)
	$(CXX) -fPIC -o $@ $(OBJ) $(LD_FLAGS)

build/test: $(TEST_OBJ)
	$(CXX) -o $@ $(TEST_OBJ) $(LD_FLAGS)

prepare:
	mkdir -p build

clean:
	rm -rf ./build
	rm src/*.o
	rm test/*.o

test: prepare build/test
	LD_LIBRARY_PATH=./build ./build/test

valgrind_test: build/test
	LD_LIBRARY_PATH=./build valgrind ./build/test

.PHONY: prepare clean test valgrind_test
{'fraction_non_alphanumeric': 0.1993753253513795, 'fraction_numerical': 0.006246746486205101, 'mean_word_length': 3.03781512605042, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3531433', 'n_tokens_mistral': 836, 'n_tokens_neox': 776, 'n_words': 192}