Skip to content

Commit

Permalink
Add Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Aug 15, 2022
1 parent c89bfe9 commit 8e89ae0
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Thumbs.db
.~lock.*

/vendor
/release
shrimp
shrimp.exe
SHA256SUMS
Expand Down
76 changes: 76 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8e89ae0

Please sign in to comment.