-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.71 KB
/
Makefile
File metadata and controls
58 lines (46 loc) · 1.71 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
57
58
APP_NAME := gostratumengine
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
BUILD_DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
LDFLAGS := -X main.version=$(VERSION) -X main.buildDate=$(BUILD_DATE) -X main.commit=$(COMMIT)
.PHONY: build build-all clean test lint
## build: Build for current platform
build:
go build -ldflags "$(LDFLAGS)" -o bin/$(APP_NAME) ./cmd/gostratumengine/
## build-linux-amd64: Build for Linux AMD64
build-linux-amd64:
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" \
-o bin/$(APP_NAME)-linux-amd64 ./cmd/gostratumengine/
## build-linux-arm64: Build for Linux ARM64
build-linux-arm64:
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" \
-o bin/$(APP_NAME)-linux-arm64 ./cmd/gostratumengine/
## build-darwin-amd64: Build for macOS AMD64
build-darwin-amd64:
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" \
-o bin/$(APP_NAME)-darwin-amd64 ./cmd/gostratumengine/
## build-darwin-arm64: Build for macOS ARM64
build-darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" \
-o bin/$(APP_NAME)-darwin-arm64 ./cmd/gostratumengine/
## build-all: Build for all supported platforms
build-all: build-linux-amd64 build-linux-arm64 build-darwin-amd64 build-darwin-arm64
## test: Run all tests
test:
go test -v ./...
## test-short: Run tests without verbose output
test-short:
go test ./...
## lint: Run go vet
lint:
go vet ./...
## clean: Remove build artifacts
clean:
rm -rf bin/
## help: Show this help
help:
@echo "GoStratumEngine - Open Source Stratum V1 Engine"
@echo ""
@echo "Usage: make [target]"
@echo ""
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /'