-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (30 loc) · 877 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
GO = GO111MODULE=on go
BINARY = senscritique
PACKAGE = ./cmd/$(BINARY)
.PHONY: all
all: help ## help
.PHONY: run
run: ## Run the program
$(GO) run $(PACKAGE)
.PHONY: install
install: ## Install binary in $GOBIN (make sure it's set in your $PATH)
$(GO) install -v $(PACKAGE)
.PHONY: build
build: ## Build binary in this directory
$(GO) build -v -o $(BINARY) $(PACKAGE)
.PHONY: dep
dep: ## Get the dependencies
$(GO) get -d -v ./...
.PHONY: test
test: ## Run unit tests
$(GO) test -v ./...
.PHONY: lint
lint: ## Lint the files (requires golangci-lint installed)
GO111MODULE=on golangci-lint run
.PHONY: clean
clean: ## Remove previous build files
rm -f $(BINARY)
.PHONY: help
help: ## Display this help screen
@echo "Usage:"
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'