Skip to content
Snippets Groups Projects
go.mk 866 B
Newer Older
#############################################################################################
#############################################################################################
##
## COMMANDS GO
##
#############################################################################################
#############################################################################################

# path and binaries
GO               := go

EXECUTABLES = $(EXECUTABLES:-) $(GO); 

ifeq ($(shell command -v $(GO) 2> /dev/null),)
  $(error "go is not installed. Please install go <https://go.dev/doc/install>")
endif
Volker Schukai's avatar
Volker Schukai committed

GOPATH=$(shell go env GOPATH)

ifeq ($(GOPATH),)
    DIRS := bin pkg src
    GOPATH=$(DEPLOYMENT_PATH)/go/
    $(shell mkdir -p $(GOPATH))
	$(shell $(foreach entry,$(DIRS),mkdir -p "$(GOPATH)$(entry)";))
    export PATH=$(PATH):$(GOPATH)/bin
endif