Skip to content
Snippets Groups Projects
Select Git revision
  • ec5624bafcabe17cb654712ec95b8e0f1c464333
  • master default protected
  • 1.0.0
3 results

Makefile

Blame
  • Makefile 1.05 KiB
    PROJECT_NAME := "connection-checker"
    PKG := "gitlab.schukai.com/oss/utilities/commerce/barcode-creator"
    PKG_LIST := $(shell go list ${PKG}/... )
    GO_FILES := $(shell find . -name '*.go')
    
    GOCMD=go
    GOBUILD=$(GOCMD) build 
    GOCLEAN=$(GOCMD) clean 
    GOTEST=$(GOCMD) test 
    GOVET=$(GOCMD) vet  
    GOGET=$(GOCMD) get 
    GOFMT=$(GOCMD) fmt 
    GODOC=$(GOCMD) fmt 
    GOLINT=golint 
    
    default: help
    
    help:   ## show this help
    	@echo 'usage: make [target] ...'
    	@echo ''
    	@echo 'targets:'
    	@egrep '^(.+)\:\ .*##\ (.+)' ${MAKEFILE_LIST} | sed 's/:.*##/#/' | column -t -c 2 -s '#'
    
    clean:  ## go clean
    	$(GOCLEAN)
    
    clean-all:  ## remove all generated artifacts and clean all build artifacts
    	$(GOCLEAN) -i ./...
    
    lint:   ## run go lint on the source files
    	$(GOLINT) -set_exit_status .
    
    doc:    ## generate godocs and start a local documentation webserver on port 8085
    	godoc -http=:8085 -index
    
    fmt:    ## format the go source files
    	$(GOFMT) .
    
    all:    ## clean, format and build
    	make clean-all
    	make fmt
    	make build
    
    build:
    	mkdir -p bin
    	$(GOCMD) build -o bin/barcode-creator 
    
    install: build