Created
February 17, 2017 19:00
-
-
Save jgworks/58de0d88f00c9b0ec39045c8fcf0dead to your computer and use it in GitHub Desktop.
Make file for go projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## simple makefile to log workflow | |
.PHONY: all test clean build install | |
GO=go | |
GOFLAGS ?= $(GOFLAGS:) | |
GOARCH ?= amd64 #$(GOARCH:amd64) | |
all: fmt vet build | |
build: | |
$(GO) build $(GOFLAGS) ./... | |
fmt: | |
$(GO) fmt $(GOFLAGS) ./... | |
imports: | |
$(GO)imports -l -w . | |
vet: | |
$(GO) vet $(GOFLAGS) ./... | |
install: | |
$(GO) get $(GOFLAGS) ./... | |
upgrade: | |
$(GO) get -u $(GOFLAGS) ./... | |
test: install | |
$(GO) test $(GOFLAGS) ./... | |
bench: install | |
$(GO) test -run=NONE -bench=. $(GOFLAGS) ./... | |
linux: | |
GOOS=linux GOARCH=$(GOARCH) make build | |
windows: | |
GOOS=windows GOARCH=$(GOARCH) make build | |
clean: | |
$(GO) clean $(GOFLAGS) -i ./... | |
## EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment