Advent of Code 2021, see plus plus edition
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
443 B

3 years ago
CXXFLAGS := -std=c++20 -O2 -Wall -Wextra
3 years ago
sources := $(wildcard *.cc)
progs := $(patsubst %.cc,%,$(sources))
.PHONY: all
all: $(progs)
.PHONY: clean
clean:
rm -f $(progs) $(progs:=_test.txt)
.PHONY: test
test: $(addprefix test-,$(progs))
.PHONY: test-%
test-%: %_test.txt
3 years ago
@test -f $*_output.txt && (diff -u $*_output.txt $<; rm -f $<) || true
3 years ago
@test -f $*_output.txt || cat $<
$(progs:=_test.txt): %_test.txt: %
./$< $*_input.txt > $@