From 8e89ae043e0026316a2ef78c65e8810454422ec6 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Sun, 14 Aug 2022 22:25:58 -0700 Subject: [PATCH] Add Makefile. --- .gitignore | 1 + Makefile | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 2293aeb..65f2322 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Thumbs.db .~lock.* /vendor +/release shrimp shrimp.exe SHA256SUMS diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0560f0f --- /dev/null +++ b/Makefile @@ -0,0 +1,76 @@ +VERSION = 0.0.1 +LDFLAGS = -ldflags '-s -w' -gcflags=-trimpath=${PWD} -asmflags=-trimpath=${PWD} + +linux_amd64: export GOOS=linux +linux_amd64: export GOARCH=amd64 +linux_arm: export GOOS=linux +linux_arm: export GOARCH=arm +linux_arm: export GOARM=6 +linux_arm64: export GOOS=linux +linux_arm64: export GOARCH=arm64 +darwin_amd64: export GOOS=darwin +darwin_amd64: export GOARCH=amd64 +darwin_arm64: export GOOS=darwin +darwin_arm64: export GOARCH=arm64 +windows_amd64: export GOOS=windows +windows_amd64: export GOARCH=amd64 +windows_arm: export GOOS=windows +windows_arm: export GOARCH=arm +windows_arm64: export GOOS=windows +windows_arm64: export GOARCH=arm64 + +.PHONY: all linux_amd64 linux_arm linux_arm64 darwin_amd64 darwin_arm64 windows_amd64 windows_arm windows_arm64 clean + +all: linux_amd64 linux_arm linux_arm64 darwin_amd64 darwin_arm64 windows_amd64 windows_arm windows_arm64 + +linux_amd64: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp + +linux_arm: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp + +linux_arm64: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp + +darwin_amd64: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp + +darwin_arm64: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp + +windows_amd64: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp.exe + +windows_arm: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp.exe + +windows_arm64: + go build $(LDFLAGS) + mkdir -p release + rm -f release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip + zip release/shrimp-${VERSION}-${GOOS}_${GOARCH}.zip shrimp.exe + +clean: + rm -rf release + rm -f shrimp shrimp.exe