diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-12-06 18:43:40 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-12-06 18:43:40 +0100 |
commit | 4225b181d04ee82ae8365a6303fe0adf916308f7 (patch) | |
tree | 4fd20ed3fa09d4964f2a0cccd4045417d41e8881 /Makefiles/go.mk | |
parent | d1b4d95b6f4be5115843752a522eb3ddd77b12a8 (diff) |
Update Makefiles
Diffstat (limited to 'Makefiles/go.mk')
-rw-r--r-- | Makefiles/go.mk | 18 |
1 files changed, 10 insertions, 8 deletions
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 |