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.
|
|
|
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
|
|
|
|
@test -f $@ || (echo $*:; cat $<)
|
|
|
|
@test -f $@ && (diff -u $@ $< && touch $@) || exit 0
|
|
|
|
|
|
|
|
$(addsuffix _test.txt,$(progs)): %_test.txt: % %_input.txt
|
|
|
|
./$< < $*_input.txt > $@
|