-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (30 loc) · 843 Bytes
/
Makefile
File metadata and controls
38 lines (30 loc) · 843 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
.PHONY: build install clean test lint
BINARY_NAME=msgcli
BUILD_DIR=./bin
CMD_PATH=./cmd/msgcli
# Build the binary
build:
go build -o $(BUILD_DIR)/$(BINARY_NAME) $(CMD_PATH)
# Install to GOPATH/bin
install:
go install $(CMD_PATH)
# Clean build artifacts
clean:
rm -rf $(BUILD_DIR)
go clean
# Run tests
test:
go test -v ./...
# Run linter
lint:
golangci-lint run
# Download dependencies
deps:
go mod download
go mod tidy
# Build for multiple platforms
release:
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 $(CMD_PATH)
GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 $(CMD_PATH)
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 $(CMD_PATH)
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(CMD_PATH)