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
609 B

CXXFLAGS := -std=c++11 -Wall -Wextra -O2 -g
#CXXFLAGS := -std=c++11 -Wall -Wextra -Og -g -fsanitize=address -fsanitize=leak -fsanitize=undefined
progs := $(patsubst %.cc,%,$(wildcard d*.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 > $@