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.
24 lines
507 B
24 lines
507 B
CXXFLAGS := -std=c++11 -Wall -Wextra -O2 -g
|
|
|
|
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 > $@
|
|
|