From ed1618c2343254aafa64d9e6c8eaab1434284d2e Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 13 Dec 2023 22:26:56 +0100 Subject: [PATCH] Add makefile --- Makefile | 32 ++++++++++++++++++++++++++++++++ d01_ok.txt | 2 ++ d02_ok.txt | 2 ++ d04_ok.txt | 2 ++ d05_ok.txt | 2 ++ 5 files changed, 40 insertions(+) create mode 100644 Makefile create mode 100644 d01_ok.txt create mode 100644 d02_ok.txt create mode 100644 d04_ok.txt create mode 100644 d05_ok.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..214a64d --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +progs_sh := d01 +progs_py := d02 d04 +progs_go := d05 + +progs := $(progs_sh) $(progs_py) $(progs_go) + +.PHONY: all +all: $(addsuffix _ok.txt,$(progs)) + +.PHONY: clean +clean: + rm -f $(addsuffix _out.txt,$(progs)) $(progs_go) + +.PHONY: ok-% +ok-%: %_out.txt + @cp -v $< $*_ok.txt + +%_ok.txt: %_out.txt + @test -f $@ || (echo $*:; cat $<) + @test -f $@ && (diff -u $@ $< && touch $@) || exit 0 + +$(addsuffix _out.txt,$(progs_sh)): %_out.txt: %.sh + ./$< $*_input.txt > $@ + +$(addsuffix _out.txt,$(progs_py)): %_out.txt: %.py + ./$< $*_input.txt > $@ + +$(addsuffix _out.txt,$(progs_go)): %_out.txt: % + ./$< $*_input.txt > $@ + +$(progs_go): %: %.go + go build -o $@ $< diff --git a/d01_ok.txt b/d01_ok.txt new file mode 100644 index 0000000..4b7edcf --- /dev/null +++ b/d01_ok.txt @@ -0,0 +1,2 @@ +56397 +55701 diff --git a/d02_ok.txt b/d02_ok.txt new file mode 100644 index 0000000..033b7ad --- /dev/null +++ b/d02_ok.txt @@ -0,0 +1,2 @@ +2169 +60948 diff --git a/d04_ok.txt b/d04_ok.txt new file mode 100644 index 0000000..dec80b1 --- /dev/null +++ b/d04_ok.txt @@ -0,0 +1,2 @@ +26346 +8467762 diff --git a/d05_ok.txt b/d05_ok.txt new file mode 100644 index 0000000..156521f --- /dev/null +++ b/d05_ok.txt @@ -0,0 +1,2 @@ +579439039 +7873084