-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 785 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
.SILENT:
APP=algo/ya-details
.PHONY: help
help: Makefile ## Show this help
@echo
@echo "Choose a command run in "$(APP)":"
@echo
@fgrep -h "##" $(MAKEFILE_LIST) | sed -e 's/\(\:.*\#\#\)/\:\ /' | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
.PHONY: build
build: ## Build an application
@echo "Building ${APP} ..."
mkdir -p build
go build -o build/${APP} main.go
run: ## Run an application
@echo "Starting ${APP} ..."
go run main.go
test: ## Run an application
@echo "Testing ${APP} ..."
go test
bench: ## Run an application
@echo "Benchmarking ${APP} ..."
go test -bench=. .
clean: ## Clean a garbage
@echo "Cleaning"
go clean
rm -rf build
lint: ## Check a code by golangci-lint
@echo "Linter checking..."
golangci-lint run --fix -c .golangci.yml ./...