-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 910 Bytes
/
Makefile
File metadata and controls
52 lines (41 loc) · 910 Bytes
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
# Makefile for epgstationctl
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
GOGENERATE=$(GOCMD) generate
GOLINT=golangci-lint
# Binary name
BINARY_NAME=epgstationctl
BINARY_PATH=./bin/$(BINARY_NAME)
# Source files
CMD_PATH=./cmd/epgstationctl
.PHONY: all build install lint test clean generate
all: lint test build
# Build the binary
build:
@echo "Building $(BINARY_NAME)..."
@$(GOBUILD) -o $(BINARY_PATH) $(CMD_PATH)
# Install the binary
install:
@echo "Installing $(BINARY_NAME)..."
@$(GOINSTALL) $(CMD_PATH)
# Run the linter
lint:
@echo "Running linter..."
@$(GOLINT) run
# Run tests
test:
@echo "Running tests..."
@$(GOTEST) ./...
# Clean up build artifacts
clean:
@echo "Cleaning..."
@$(GOCLEAN)
@rm -f $(BINARY_PATH)
# Generate API client
generate:
@echo "Generating API client..."
@cd api && $(GOGENERATE) .