-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (25 loc) · 819 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
DIST := bin
BINARIES := $(DIST)/ecs-log-viewer
SOURCES := $(shell find . -name '*.go')
.PHONY: all build clean run lint help test test-coverage
help: ## Show this help
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/\(.*\):.*##\(.*\)/ \1: \2/'
$(DIST):
mkdir -p $(DIST)
$(BINARIES): $(DIST) $(SOURCES)
go build -o $(BINARIES) ./cmd/ecs-log-viewer
build: $(BINARIES) ## Build the application
run: build ## Run the application
$(BINARIES)
test: ## Run tests
go test -v ./...
test-coverage: ## Run tests with coverage
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
lint: ## Run linter
golangci-lint run ./...
clean: ## Clean build artifacts
rm -rf $(DIST) coverage.out coverage.html