CXX = g++
CXXFLAGS = -O3 -std=c++17 -pthread
TARGET = lab2

all: $(TARGET)

$(TARGET): main.cpp
	$(CXX) $(CXXFLAGS) main.cpp -o $(TARGET)

run_all: $(TARGET)
	@mkdir -p out/timelines
	@echo "1. Generating Timelines (N=1000, Threshold=10)..."
	./$(TARGET) 1000 2 10 > out/timelines/log_t2.txt
	./$(TARGET) 1000 4 10 > out/timelines/log_t4.txt
	python3 exporter.py out/timelines/log_t2.txt out/timelines/
	python3 exporter.py out/timelines/log_t4.txt out/timelines/

	@echo "2. Generating Efficiency Benchmark..."
	python3 benchmark.py

clean:
	rm -rf $(TARGET) *.txt out/
