# Generated for KENHOLT Skills. Usage: make | make test | make clean
CXX = g++
CXXFLAGS = -std=c++17 -Wall -Wextra -O2
SRC := $(wildcard src/*.cpp)
HDR := $(wildcard src/*.h src/*.hpp)
ARGS := $(shell cat tests/args.txt 2>/dev/null)
INPUT := $(wildcard tests/sample-input.txt)

app: $(SRC) $(HDR)
	$(CXX) $(CXXFLAGS) -Isrc $(SRC) -o app

test: app
	./app $(ARGS) $(if $(INPUT),< $(INPUT),) > actual.txt
	diff actual.txt tests/expected-output.txt && echo "Test passed: output matches tests/expected-output.txt"

clean:
	rm -f app app.exe actual.txt

.PHONY: test clean
