Skip to content

Instantly share code, notes, and snippets.

@fannheyward
Last active March 26, 2019 09:30
Show Gist options
  • Save fannheyward/d58f66c91f7f052e0a27acf2d700103a to your computer and use it in GitHub Desktop.
Save fannheyward/d58f66c91f7f052e0a27acf2d700103a to your computer and use it in GitHub Desktop.
Makefile for go
ifndef VERBOSE
.SILENT:
endif
BINARY=$(shell basename $(CURDIR))
BINARY_LINUX=$(BINARY)_linux
export GO111MODULE=on
.PHONY : default
default: build
install:
go clean && go install
build:
go clean && go build -o ${BINARY}
linux:
go clean && GOOS=linux GOARCH=amd64 go build -o ${BINARY_LINUX}
dev:
go get github.com/cespare/reflex
reflex -r '\.go$$' -s go run .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment