CXXFLAGS ?= -O3 -Wall -Wextra -Wpedantic
CXXFLAGS += -std=c++20
BUILD = .build

.PHONY: all test
all: $(BUILD)/author $(BUILD)/replay

$(BUILD):
	mkdir -p $@

$(BUILD)/json.o: json.cpp | $(BUILD)
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

$(BUILD)/%: %.cpp common.hpp $(BUILD)/json.o
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $< $(BUILD)/json.o $(LDFLAGS) -o $@

test: all
	python3 -B -m unittest -v test_large.py
