Last active
August 29, 2015 14:12
-
-
Save rmulley/a7184ce6ef2fb998b61d to your computer and use it in GitHub Desktop.
Go Makefile
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
GO ?= go | |
export GOPATH := $(CURDIR)/_vendor:$(GOPATH) | |
all: build | |
build: | |
$(GO) fmt src/* | |
$(GO) vet src/* | |
$(GO) build -o ./bin/program_name src/main.go | |
linux: | |
$(GO) fmt src/* | |
$(GO) vet src/* | |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/program_name src/main.go | |
test: | |
$(GO) test src/* -v -cover | |
bench: | |
$(GO) test src/* -v -bench=. | |
clean: | |
rm -r -f _vendor/pkg/darwin_amd64/ | |
rm -r -f _vendor/pkg/linux_amd64/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment