Skip to content

Commit

Permalink
Makefile build multi os
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Dec 19, 2018
1 parent 55316c5 commit ea2b9f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ bin=ydcv
all: clean $(bin)

$(bin):
for ARCH in amd64 386; do \
for OS in windows linux darwin; do \
CGO_ENABLED=0 GOARCH=$(ARCH) GOOS=$(OS) go build -o $(bin)_$(OS)_$(ARCH) -ldflags "-s -w -X main.VERSION=git-$$(git rev-parse --short HEAD)"; \
done; \
done;
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o $(bin) -ldflags "-s -w -X main.VERSION=git-$$(git rev-parse --short HEAD)"; \
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o $(bin).exe -ldflags "-s -w -X main.VERSION=git-$$(git rev-parse --short HEAD)"; \
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -o $(bin)_darwin -ldflags "-s -w -X main.VERSION=git-$$(git rev-parse --short HEAD)"; \

clean:
rm -fv $(bin)_*

0 comments on commit ea2b9f1

Please sign in to comment.