-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (39 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
56 lines (39 loc) · 1.6 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.PHONY: clean run build install dep test lint format docker migration tools tools-golangci-lint tools-model-garage codegen
# Set the bin path
SHELL := /bin/sh
PATHINSTBIN = $(abspath ./bin)
export PATH := $(PATHINSTBIN):$(PATH)
BIN_NAME ?= server-garage
DEFAULT_INSTALL_DIR := $(go env GOPATH)/bin
DEFAULT_ARCH := $(shell go env GOARCH)
DEFAULT_GOOS := $(shell go env GOOS)
ARCH ?= $(DEFAULT_ARCH)
GOOS ?= $(DEFAULT_GOOS)
INSTALL_DIR ?= $(DEFAULT_INSTALL_DIR)
.DEFAULT_GOAL := run
VERSION := $(shell git describe --tags || echo "v0.0.0")
VER_CUT := $(shell echo $(VERSION) | cut -c2-)
# Dependency versions
GOLANGCI_VERSION = v2.12.1
CLICKHOUSE_INFRA_VERSION = $(shell go list -m -f '{{.Version}}' github.com/DIMO-Network/clickhouse-infra)
help:
@echo "\nSpecify a subcommand:\n"
@grep -hE '^[0-9a-zA-Z_-]+:.*?## .*$$' ${MAKEFILE_LIST} | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[0;36m%-20s\033[m %s\n", $$1, $$2}'
@echo ""
all: clean target
clean: ## Clean the project binaries
@rm -rf $(PATHINSTBIN)
tidy: ## tidy the go modules
@go mod tidy
test: ## Run the all tests
@go test ./...
lint: ## Run the linter
@PATH=$$PATH golangci-lint version
@PATH=$$PATH golangci-lint run --timeout=5m
generate: generate-go ## Generate all code
generate-go: ## Generate the go code for the project
@go generate ./...
tools: tools-golangci-lint ## Install all tools
tools-golangci-lint: ## Install golangci-lint
@mkdir -p $(PATHINSTBIN)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/$(GOLANGCI_VERSION)/install.sh | sh -s -- -b $(PATHINSTBIN) $(GOLANGCI_VERSION)