Skip to content

Commit

Permalink
add build flags to reduce binary size
Browse files Browse the repository at this point in the history
  • Loading branch information
cj1128 committed Feb 16, 2017
1 parent d2ddf85 commit 67491f7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
flags = "-X main.appVersion=`cat VERSION`"
flags := -X main.appVersion=`cat VERSION`
build_flags := $(flags) -s -w

install:
godep go install -ldflags $(flags)
godep go install -ldflags "$(flags)"
.PHONY: install

build:
GOOS=darwin godep go build -ldflags $(flags) -o tmp/codeposter-oxs-$$(cat VERSION)
GOOS=linux godep go build -ldflags $(flags) -o tmp/codeposter-linux-$$(cat VERSION)
GOOS=windows godep go build -ldflags $(flags) -o tmp/codeposter-windows-$$(cat VERSION)
.PHONY: install
GOOS=darwin godep go build -ldflags "$(build_flags)" -o tmp/codeposter-oxs-$$(cat VERSION)
GOOS=linux godep go build -ldflags "$(build_flags)" -o tmp/codeposter-linux-$$(cat VERSION)
GOOS=windows godep go build -ldflags "$(build_flags)" -o tmp/codeposter-windows-$$(cat VERSION)
.PHONY: build

0 comments on commit 67491f7

Please sign in to comment.