Skip to content

Instantly share code, notes, and snippets.

@AxelRHD
Created July 18, 2019 19:44
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 AxelRHD/1cf2bad7c1e8359f4db8fd1d9c2aec54 to your computer and use it in GitHub Desktop.
Save AxelRHD/1cf2bad7c1e8359f4db8fd1d9c2aec54 to your computer and use it in GitHub Desktop.
Makefile for GO
# Go
GOCMD=go
XGO=xgo
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
BINARY_NAME=my-app
exec: run clean
build:
$(GOBUILD) -o $(BINARY_NAME) -v
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)*
build-win:
$(XGO) --targets=windows-6.1/* -out $(BINARY_NAME) .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment