<commit_before>CC = g++
CPPFLAGS = -DGTEST_HAS_PTHREAD=0 -DDEBUG -DPREC
CXXFLAGS = -g -std=c++11

LIBS = -ldl
INCLUDES = -I./include

EXECUTABLE = run.out
EXECUTABLE_SRC = main.cpp
EXECUTABLE_OBJ = $(EXECUTABLE_SRC:.cpp=.o)
TEST_EXECUTABLE = test.out

SRC_DIR = src
INCLUDE_DIR =include
TEST_DIR = tests
DOC_DIR = docs

SRCS = $(wildcard $(SRC_DIR)/*.cpp)
OBJS = $(SRCS:.cpp=.o)
SRCS_TEST = $(wildcard $(TEST_DIR)/*.cpp)
OBJS_TEST = $(SRCS_TEST:.cpp=.o)

MOCKED_SO = tests/pkcs11mocked.so

RM = /usr/bin/rm

%.o: %.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: GCC Compiler'
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -O0 -Wall -c -o "$@" "$<" $(LIBS)
	@echo 'Finished building: $<'
	@echo ' '

all: $(OBJS) $(EXECUTABLE_OBJ)
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -o $(EXECUTABLE) $(LIBS) $(OBJS) $(EXECUTABLE_OBJ)
	@echo 'Build complete!'
	@echo ' '

$(MOCKED_SO):
	@echo 'Building Mocked PKCS11'
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -shared -fPIC -o $(MOCKED_SO) $(LIBS) tests/mock/*.cpp
	@echo ' '

test: $(OBJS) $(OBJS_TEST) $(MOCKED_SO)
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -o $(TEST_EXECUTABLE) $(LIBS) $(OBJS) $(OBJS_TEST) -lgtest
	@echo 'Test build complete!'
	@echo ' '

clean: 
	$(RM) -f $(SRC_DIR)/*.o
	$(RM) -f $(TEST_DIR)/*.o
	$(RM) -f $(EXECUTABLE)
	$(RM) -f $(MOCKED_SO)
	$(RM) -f $(TEST_EXECUTABLE)
	$(RM) -rf $(DOC_DIR)<commit_msg>Added make run and make runtest<commit_after>SHELL = /bin/bash
CC = g++
CPPFLAGS = -DGTEST_HAS_PTHREAD=0 -DDEBUG -DPREC
CXXFLAGS = -g -std=c++11

LIBS = -ldl
INCLUDES = -I./include

EXECUTABLE = run.out
EXECUTABLE_SRC = main.cpp
EXECUTABLE_OBJ = $(EXECUTABLE_SRC:.cpp=.o)
TEST_EXECUTABLE = test.out

SRC_DIR = src
INCLUDE_DIR =include
TEST_DIR = tests
DOC_DIR = docs

SRCS = $(wildcard $(SRC_DIR)/*.cpp)
OBJS = $(SRCS:.cpp=.o)
SRCS_TEST = $(wildcard $(TEST_DIR)/*.cpp)
OBJS_TEST = $(SRCS_TEST:.cpp=.o)

MOCKED_SO = tests/pkcs11mocked.so

RM = /bin/rm

%.o: %.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: GCC Compiler'
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -O0 -Wall -c -o "$@" "$<" $(LIBS)
	@echo 'Finished building: $<'
	@echo ' '

all: $(OBJS) $(EXECUTABLE_OBJ)
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -o $(EXECUTABLE) $(LIBS) $(OBJS) $(EXECUTABLE_OBJ)
	@echo 'Build complete!'
	@echo ' '

$(MOCKED_SO):
	@echo 'Building Mocked PKCS11'
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -shared -fPIC -o $(MOCKED_SO) $(LIBS) tests/mock/*.cpp
	@echo ' '

test: $(OBJS) $(OBJS_TEST) $(MOCKED_SO)
	$(CC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -o $(TEST_EXECUTABLE) $(LIBS) $(OBJS) $(OBJS_TEST) -lgtest
	@echo 'Test build complete!'
	@echo ' '

clean: 
	$(RM) -f $(SRC_DIR)/*.o
	$(RM) -f $(TEST_DIR)/*.o
	$(RM) -f $(EXECUTABLE)
	$(RM) -f $(MOCKED_SO)
	$(RM) -f $(TEST_EXECUTABLE)
	$(RM) -rf $(DOC_DIR)

run: 	all
	./$(EXECUTABLE)


runtest: all test
	./$(TEST_EXECUTABLE)
{'fraction_non_alphanumeric': 0.21705426356589147, 'fraction_numerical': 0.005637773079633545, 'mean_word_length': 4.4282982791587, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6548590', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1257, 'n_words': 283}