-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.01 KB
/
Makefile
File metadata and controls
56 lines (43 loc) · 1.01 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
# Makefile for go-binspect
# Binary name
BINARY_NAME=binspect
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOCLEAN=$(GOCMD) clean
# Build directory
BUILD_DIR=.
# Main package path
MAIN_PACKAGE=./cmd/binspect
.PHONY: all build clean test coverage help install
all: build
## build: Build the binary
build:
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) $(MAIN_PACKAGE)
## clean: Clean build artifacts
clean:
$(GOCLEAN)
rm -f $(BUILD_DIR)/$(BINARY_NAME)
## test: Run tests
test:
$(GOTEST) -v ./...
## coverage: Run tests with coverage
coverage:
$(GOTEST) -v -coverprofile=coverage.out ./...
$(GOCMD) tool cover -html=coverage.out -o coverage.html
## install: Install the binary
install:
$(GOCMD) install $(MAIN_PACKAGE)
## deps: Download dependencies
deps:
$(GOMOD) download
$(GOMOD) tidy
## help: Show this help message
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@sed -n 's/^##//p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'