Skip to content

Instantly share code, notes, and snippets.

@brainwire
Created June 9, 2016 15:09
Show Gist options
  • Save brainwire/929e5244eac5a2372a831b36b69a907d to your computer and use it in GitHub Desktop.
Save brainwire/929e5244eac5a2372a831b36b69a907d to your computer and use it in GitHub Desktop.
Go Make
PLATFORMS := linux/amd64 windows/amd64
temp = $(subst /, ,$@)
os = $(word 1, $(temp))
arch = $(word 2, $(temp))
release: $(PLATFORMS)
$(PLATFORMS):
GOOS=$(os) GOARCH=$(arch) go build -o '$(os)-$(arch)' mypackage
.PHONY release $(PLATFORMS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment