From 4225b181d04ee82ae8365a6303fe0adf916308f7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 6 Dec 2024 18:43:40 +0100 Subject: Update Makefiles --- Makefiles/go.mk | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Makefiles/go.mk') diff --git a/Makefiles/go.mk b/Makefiles/go.mk index b5e95cd..a0c7c23 100644 --- a/Makefiles/go.mk +++ b/Makefiles/go.mk @@ -1,13 +1,15 @@ .POSIX: all: - sed '/START PART 2/,/END PART 2/d' puzzles.go >tmp1.go - sed '/START PART 1/,/END PART 1/d' puzzles.go >tmp2.go - go build tmp1.go - go build tmp2.go - mv tmp1 puzzle-1 - mv tmp2 puzzle-2 - rm -f tmp[12].go + f() { \ + n=$$(expr \( $$1 - 1 \| 2 \)); \ + sed "/START PART $$n/,/END PART $$n/d" puzzles.go >tmp$$1.go; \ + go build tmp$$1.go; \ + mv tmp$$1 puzzle-$$1; \ + rm -f tmp$$1; \ + }; \ + f 1; \ + f 2; clean: - rm -f puzzle-[12] + rm -f puzzle-[12] \ No newline at end of file -- cgit v1.2.3