Skip to content

Instantly share code, notes, and snippets.

@L-P
Created December 13, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save L-P/78b28dfd1fc2c2458c91193af9ea9411 to your computer and use it in GitHub Desktop.
Save L-P/78b28dfd1fc2c2458c91193af9ea9411 to your computer and use it in GitHub Desktop.
Generic golang command Makefile
VERSION=$(shell git describe --tags)
BUILDFLAGS=-ldflags '-X main.Version=${VERSION}'
EXEC=$(shell basename "$(shell pwd)")
all: $(EXEC)
$(EXEC):
go build ${BUILDFLAGS}
.PHONY: $(EXEC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment