Makefile 765 Bytes
Newer Older
Lukas Burgey's avatar
Add CI  
Lukas Burgey committed
1
2
3
4
5
PROJECT_NAME := "feudalClient"
PKG := "git.scc.kit.edu/feudal/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)

Lukas Burgey's avatar
Lukas Burgey committed
6
.PHONY: all dep build clean test  lint
Lukas Burgey's avatar
Add CI  
Lukas Burgey committed
7
8
9

all: build

Lukas Burgey's avatar
Lukas Burgey committed
10
11
12
13
14
dep: ## Get the dependencies
	@go get -v -d ./...
	@go get -u golang.org/x/lint/golint

lint: dep ## Lint the files
Lukas Burgey's avatar
Add CI  
Lukas Burgey committed
15
16
17
18
19
20
21
22
23
24
25
26
27
	@golint -set_exit_status ${PKG_LIST}

test: ## Run unittests
	@go test -short ${PKG_LIST}

build: dep ## Build the binary file
	@go build -i -v $(PKG)

clean: ## Remove previous build
	@rm -f $(PROJECT_NAME)

help: ## Display this help screen
	@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'