-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (44 loc) · 1.15 KB
/
Makefile
File metadata and controls
55 lines (44 loc) · 1.15 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
.PHONY: build build-linux test clean run install
# Binary name
BINARY=mcp-sysmon
# Build the binary
build:
go build -o $(BINARY) .
# Build for Linux amd64
build-linux:
GOOS=linux GOARCH=amd64 go build -o $(BINARY)-linux-amd64 .
# Build for all platforms
build-all: build-linux
GOOS=darwin GOARCH=amd64 go build -o $(BINARY)-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o $(BINARY)-darwin-arm64 .
# Run tests
test:
go test -v ./...
# Clean build artifacts
clean:
rm -f $(BINARY) $(BINARY)-*
# Run the server (for testing)
run: build
./$(BINARY)
# Install to system
install: build
cp $(BINARY) /usr/local/bin/
# Update dependencies
deps:
go mod tidy
go mod download
# Lint the code
lint:
golangci-lint run
# Show help
help:
@echo "Available targets:"
@echo " build - Build the binary"
@echo " build-linux - Build for Linux amd64"
@echo " build-all - Build for all platforms"
@echo " test - Run tests"
@echo " clean - Remove build artifacts"
@echo " run - Build and run the server"
@echo " install - Install to /usr/local/bin"
@echo " deps - Update dependencies"
@echo " lint - Run linter"