Skip to content

Commit

Permalink
ADD: cross compile script
Browse files Browse the repository at this point in the history
  • Loading branch information
go-compile committed Jan 13, 2022
1 parent 02db5e9 commit 1068794
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.pem
*.ppk
*.psk
bin/
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build:
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o ../bin/qrsecrets-windows-x64.exe
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-windows.exe
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-windows-arm64.exe

GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-darwin
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-darwin-arm64

GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-linux-64
GOOS=linux GOARCH=386 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-linux
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-linux-arm64

GOOS=freebsd GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-freebsd-64
GOOS=freebsd GOARCH=386 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-freebsd
GOOS=freebsd GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-freebsd-arm64

GOOS=openbsd GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-openbsd-64
GOOS=openbsd GOARCH=386 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-openbsd
GOOS=openbsd GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o ./bin/qrsecrets-openbsd-arm64

clean:
rm -rf ./bin/

0 comments on commit 1068794

Please sign in to comment.