Advent of Code 2022 - 2nd attempt in c++
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.

25 lines
503 B

2 years ago
CXXFLAGS := -std=c++11 -Wall -Wextra -O2
progs := $(patsubst %.cc,%,$(wildcard *.cc))
.PHONY: all
all: $(addsuffix _output.txt,$(progs))
.PHONY: clean
clean:
rm -f $(progs) $(addsuffix _test.txt,$(progs))
.PHONY: ok-%
ok-%: %_test.txt
@cp -v $< $*_output.txt
.PHONY: test-%
test-%: %_output.txt
%_output.txt: %_test.txt
2 years ago
@test -f $@ || (echo $*:; cat $<)
@test -f $@ && (diff -u $@ $< && touch $@) || exit 0
2 years ago
2 years ago
$(addsuffix _test.txt,$(progs)): %_test.txt: % %_input.txt
2 years ago
./$< < $*_input.txt > $@