-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (44 loc) · 1.52 KB
/
Makefile
File metadata and controls
53 lines (44 loc) · 1.52 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
BINARY_NAME=crypto-graph-tui
VERSION=1.1.1
BUILD_DIR=bin
GOOS?=$(shell go env GOOS)
GOARCH?=$(shell go env GOARCH)
BINARY_TARGET=$(BINARY_NAME)-$(GOOS)-$(GOARCH)
EXT :=
ifeq ($(GOOS),windows)
EXT = .exe
endif
.PHONY: build build-all build-linux build-windows build-darwin clean test help
help:
@echo "crypto-graph-tui - Terminal Crypto Candle Chart Viewer"
@echo ""
@echo "Available targets:"
@echo " build - Build for current OS"
@echo " build-all - Build for Linux, Windows, and macOS (Intel & Silicon)"
@echo " test - Run all tests"
@echo " clean - Remove build artifacts"
@echo " help - Show this help message"
build: clean
@mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/$(BINARY_TARGET)$(EXT) .
@echo "✓ Built: $(BUILD_DIR)/$(BINARY_TARGET)$(EXT)"
build-linux:
@mkdir -p $(BUILD_DIR)
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 .
@echo "✓ Built Linux (amd64)"
build-windows:
@mkdir -p $(BUILD_DIR)
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe .
@echo "✓ Built Windows (amd64)"
build-darwin:
@mkdir -p $(BUILD_DIR)
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 .
@echo "✓ Built macOS (amd64 & arm64)"
build-all: clean build-linux build-windows build-darwin
@echo "✓ All platforms built in ./$(BUILD_DIR)"
test:
go test -v -cover ./...
clean:
rm -rf $(BUILD_DIR)
@echo "✓ Cleaned"