From 38226a350f111cf1d9fe83182fbde8d3dd94c8ab Mon Sep 17 00:00:00 2001 From: Szymon P Date: Tue, 6 Jan 2026 18:13:22 +0100 Subject: [PATCH] updated makefile for new tests --- src/makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/makefile b/src/makefile index f596499..934f001 100644 --- a/src/makefile +++ b/src/makefile @@ -2,6 +2,7 @@ CXX = g++ CXXFLAGS = -std=c++17 -Wall TEST_LIBS = -lmd4c-html -lCatch2Main -lCatch2 LIBS = -lmd4c-html +TEST_DIR = tests all: blog @@ -20,14 +21,14 @@ utils.o: utils.cpp utils.hpp markdown.o: markdown.cpp markdown.hpp $(CXX) $(CXXFLAGS) -c markdown.cpp -tests: tests.o config.o utils.o markdown.o - g++ -std=c++17 -Wall tests.o config.o utils.o markdown.o -o tests $(TEST_LIBS) +tests.o: $(TEST_DIR)/tests.cpp config.hpp + $(CXX) $(CXXFLAGS) -c $(TEST_DIR)/tests.cpp -tests.o: tests.cpp config.hpp - $(CXX) $(CXXFLAGS) -c tests.cpp +tests: tests.o config.o utils.o markdown.o + g++ -std=c++17 -Wall tests.o config.o utils.o markdown.o -o $(TEST_DIR)/tests $(TEST_LIBS) check: tests - ./tests + $(TEST_DIR)/tests clean: - rm -f *.o blog tests + rm -f *.o $(TEST_DIR)/*.o blog $(TEST_DIR)/tests