<commit_before>.PHONY: all clean loc rebuild test
.SUFFIXES: .cpp .o

# definitions

COMPILER = g++

COMPILER_FLAGS = -c -Wall -Wextra -Werror -I$(HEADERS) \
$(DEFINES)

STRICT_COMPILER_FLAGS = -c -Wall -Wextra -Werror -Wunreachable-code \
-Wredundant-decls -Wwrite-strings -Wundef -Wendif-labels -Wcast-qual -pedantic \
-I$(HEADERS) $(DEFINES)

DEFINES =

DELETE = rm -f -v

FINAL_EXE = peachy.exe

HEADERS = ./src/main/includes

OBJECTS = additionexpression.o assignmentexpression.o booleanexpression.o \
booleanliteralexpression.o class.o classfactory.o environment.o expression.o \
expressionconsumer.o  expressionfactory.o expressionsource.o \
filescriptsource.o function.o int.o intliteralexpression.o interpreter.o \
istreamscriptsource.o lexer.o log.o nativefunction.o nullostream.o object.o \
peachy.o parser.o print.o quitexpression.o replscriptsource.o runtime.o \
scope.o script.o scriptsource.o string.o stringliteralexpression.o \
stringscriptsource.o token.o tokenfactory.o tokensource.o valueexpression.o \
variableexpression.o

SOURCE = ./src/main/src

TEST_COMPILER_FLAGS = -c -Wall -Wextra -Werror -I$(HEADERS) -I$(TEST_HEADERS) $(DEFINES)

STRICT_TEST_COMPILER_FLAGS = -c -Wall -Wextra -Werror -Wunreachable-code \
-Wredundant-decls -Wwrite-strings -Wundef -Wendif-labels -Wcast-qual -pedantic \
-I$(HEADERS) -I$(TEST_HEADERS) $(DEFINES)

TEST_EXE = ./testpeachy.exe

TEST_HEADERS = ./src/test/includes

TEST_OBJECTS = $(TESTS)/expressionfactorysuite.o \
$(TESTS)/filescriptsourcesuite.o $(TESTS)/lexersuite.o $(TESTS)/testsuite.o \
$(TESTS)/tokenfactorysuite.o

TEST_SOURCE = ./src/test/src

TESTS = ./src/test

# main targets

all: $(FINAL_EXE) $(TEST_EXE) test

$(FINAL_EXE): main.o $(OBJECTS)
	$(COMPILER) -static -o $(FINAL_EXE) main.o $(OBJECTS)

$(TEST_EXE): $(TESTS)/testmain.o $(TEST_OBJECTS)
	$(COMPILER) -static -o $(TEST_EXE) $(TESTS)/testmain.o $(TEST_OBJECTS) $(OBJECTS)

clean:
	$(DELETE) *.exe *.o $(TESTS)/*.o

rebuild: clean all

test: $(TEST_EXE)
	$(TEST_EXE)

# objects with entry points

main.o: $(SOURCE)/main.cpp $(HEADERS)/classfactory.h $(HEADERS)/environment.h \
$(HEADERS)/expression.h $(HEADERS)/expressionconsumer.h \
$(HEADERS)/expressionfactory.h $(HEADERS)/expressionsource.h \
$(HEADERS)/filescriptsource.h $(HEADERS)/interpreter.h $(HEADERS)/lexer.h \
$(HEADERS)/log.h $(HEADERS)/nullostream.h $(HEADERS)/peachy.h \
$(HEADERS)/parser.h $(HEADERS)/replscriptsource.h $(HEADERS)/runtime.h \
$(HEADERS)/script.h $(HEADERS)/scriptsource.h $(HEADERS)/tokenfactory.h \
$(HEADERS)/tokensource.h
	$(COMPILER) $(COMPILER_FLAGS) $(SOURCE)/main.cpp

$(TESTS)/testmain.o: $(TEST_SOURCE)/expressionfactorysuite.cpp \<commit_msg>Don't use -static when linking<commit_after>.PHONY: all clean loc rebuild test
.SUFFIXES: .cpp .o

# definitions

COMPILER = g++

COMPILER_FLAGS = -c -Wall -Wextra -Werror -I$(HEADERS) \
$(DEFINES)

STRICT_COMPILER_FLAGS = -c -Wall -Wextra -Werror -Wunreachable-code \
-Wredundant-decls -Wwrite-strings -Wundef -Wendif-labels -Wcast-qual -pedantic \
-I$(HEADERS) $(DEFINES)

DEFINES =

DELETE = rm -f -v

FINAL_EXE = peachy.exe

HEADERS = ./src/main/includes

OBJECTS = additionexpression.o assignmentexpression.o booleanexpression.o \
booleanliteralexpression.o class.o classfactory.o environment.o expression.o \
expressionconsumer.o  expressionfactory.o expressionsource.o \
filescriptsource.o function.o int.o intliteralexpression.o interpreter.o \
istreamscriptsource.o lexer.o log.o nativefunction.o nullostream.o object.o \
peachy.o parser.o print.o quitexpression.o replscriptsource.o runtime.o \
scope.o script.o scriptsource.o string.o stringliteralexpression.o \
stringscriptsource.o token.o tokenfactory.o tokensource.o valueexpression.o \
variableexpression.o

SOURCE = ./src/main/src

TEST_COMPILER_FLAGS = -c -Wall -Wextra -Werror -I$(HEADERS) -I$(TEST_HEADERS) $(DEFINES)

STRICT_TEST_COMPILER_FLAGS = -c -Wall -Wextra -Werror -Wunreachable-code \
-Wredundant-decls -Wwrite-strings -Wundef -Wendif-labels -Wcast-qual -pedantic \
-I$(HEADERS) -I$(TEST_HEADERS) $(DEFINES)

TEST_EXE = ./testpeachy.exe

TEST_HEADERS = ./src/test/includes

TEST_OBJECTS = $(TESTS)/expressionfactorysuite.o \
$(TESTS)/filescriptsourcesuite.o $(TESTS)/lexersuite.o $(TESTS)/testsuite.o \
$(TESTS)/tokenfactorysuite.o

TEST_SOURCE = ./src/test/src

TESTS = ./src/test

# main targets

all: $(FINAL_EXE) $(TEST_EXE) test

$(FINAL_EXE): main.o $(OBJECTS)
	$(COMPILER) -o $(FINAL_EXE) main.o $(OBJECTS)

$(TEST_EXE): $(TESTS)/testmain.o $(TEST_OBJECTS)
	$(COMPILER) -o $(TEST_EXE) $(TESTS)/testmain.o $(TEST_OBJECTS) $(OBJECTS)

clean:
	$(DELETE) *.exe *.o $(TESTS)/*.o

rebuild: clean all

test: $(TEST_EXE)
	$(TEST_EXE)

# objects with entry points

main.o: $(SOURCE)/main.cpp $(HEADERS)/classfactory.h $(HEADERS)/environment.h \
$(HEADERS)/expression.h $(HEADERS)/expressionconsumer.h \
$(HEADERS)/expressionfactory.h $(HEADERS)/expressionsource.h \
$(HEADERS)/filescriptsource.h $(HEADERS)/interpreter.h $(HEADERS)/lexer.h \
$(HEADERS)/log.h $(HEADERS)/nullostream.h $(HEADERS)/peachy.h \
$(HEADERS)/parser.h $(HEADERS)/replscriptsource.h $(HEADERS)/runtime.h \
$(HEADERS)/script.h $(HEADERS)/scriptsource.h $(HEADERS)/tokenfactory.h \
$(HEADERS)/tokensource.h
	$(COMPILER) $(COMPILER_FLAGS) $(SOURCE)/main.cpp

$(TESTS)/testmain.o: $(TEST_SOURCE)/expressionfactorysuite.cpp \
{'fraction_non_alphanumeric': 0.15808203783480052, 'fraction_numerical': 0.0, 'mean_word_length': 4.680851063829787, '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': '4237791', 'n_tokens_mistral': 1993, 'n_tokens_neox': 1959, 'n_words': 376}