Skip to content

Instantly share code, notes, and snippets.

@rmulley
Last active August 29, 2015 14:12
Show Gist options
  • Save rmulley/a7184ce6ef2fb998b61d to your computer and use it in GitHub Desktop.
Save rmulley/a7184ce6ef2fb998b61d to your computer and use it in GitHub Desktop.
Go Makefile
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