CXX      := g++
PYTHON   := python3
PIP      := $(PYTHON) -m pip

CXXFLAGS := -Wall -Wextra -O2 -std=c++17
LDFLAGS  := -lrt

TARGET   := lab1
SRC      := main.cpp

LOG_FILE := log.txt

MD_FILE  := processes.md
IMG_FILE := gantt.png

PY_EXPORT := exporter.py

.PHONY: all run log export report deps clean rebuild

all: $(TARGET)

$(TARGET): $(SRC)
	$(CXX) $(CXXFLAGS) $(SRC) -o $(TARGET) $(LDFLAGS)

run: $(TARGET)
	./$(TARGET)

export: $(TARGET)
	./$(TARGET) > $(LOG_FILE)
	$(PYTHON) $(PY_EXPORT) $(LOG_FILE)

clean:
	rm -f $(TARGET) $(LOG_FILE) $(MD_FILE) $(IMG_FILE)
