Skip to content

Commit

Permalink
Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjohnson committed May 6, 2015
1 parent 647799a commit d1851f3
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ GOLDFLAGS="-X main.version $(VERSION)"

default:

bin:
mkdir -p bin
rm -rf bin/*

release: release-windows release-darwin release-linux

release-windows:
mkdir -p bin/windows/amd64
GOOS=windows GOARCH=amd64 go build -ldflags=$(GOLDFLAGS) -o bin/windows/amd64/ego ./cmd/ego
release-windows: bin
GOOS=windows GOARCH=amd64 go build -ldflags=$(GOLDFLAGS) -o bin/ego ./cmd/ego
cd bin && tar -cvzf ego$(VERSION).windows-amd64.tgz ego
rm bin/ego

release-darwin:
mkdir -p bin/darwin/amd64
GOOS=darwin GOARCH=amd64 go build -ldflags=$(GOLDFLAGS) -o bin/darwin/amd64/ego ./cmd/ego
release-darwin: bin
GOOS=darwin GOARCH=amd64 go build -ldflags=$(GOLDFLAGS) -o bin/ego ./cmd/ego
cd bin && tar -cvzf ego$(VERSION).darwin-amd64.tgz ego
rm bin/ego

release-linux:
mkdir -p bin/linux/amd64
GOOS=linux GOARCH=amd64 go build -ldflags=$(GOLDFLAGS) -o bin/linux/amd64/ego ./cmd/ego
release-linux: bin
GOOS=linux GOARCH=amd64 go build -ldflags=$(GOLDFLAGS) -o bin/ego ./cmd/ego
cd bin && tar -cvzf ego$(VERSION).linux-amd64.tgz ego
rm bin/ego

.PHONY: default release
.PHONY: bin default release

0 comments on commit d1851f3

Please sign in to comment.