Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Nov 25, 2017
1 parent d6048f9 commit c02e505
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
VERSION = 0.0.1
LDFLAGS = -ldflags '-s -w'
GOARCH = amd64
linux: export GOOS=linux
darwin: export GOOS=darwin
windows: export GOOS=windows

all: linux darwin windows

linux:
go build $(LDFLAGS)
mkdir -p release
rm -f release/terraform-provider-ssh_${VERSION}_${GOOS}_${GOARCH}.xz
xz terraform-provider-ssh
mv terraform-provider-ssh.xz release/terraform-provider-ssh_${VERSION}_${GOOS}_${GOARCH}.xz

darwin:
go build $(LDFLAGS)
mkdir -p release
rm -f release/terraform-provider-ssh_${VERSION}_${GOOS}_${GOARCH}.xz
xz terraform-provider-ssh
mv terraform-provider-ssh.xz release/terraform-provider-ssh_${VERSION}_${GOOS}_${GOARCH}.xz

windows:
go build $(LDFLAGS)
mkdir -p release
rm -f release/terraform-provider-ssh_${VERSION}_${GOOS}_${GOARCH}.xz
xz terraform-provider-ssh.exe
mv terraform-provider-ssh.exe.xz release/terraform-provider-ssh_${VERSION}_${GOOS}_${GOARCH}.exe.xz

.PHONY: clean
clean:
rm -rf release
rm -f terraform-provider-ssh terraform-provider-ssh.exe

0 comments on commit c02e505

Please sign in to comment.