-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
138 lines (107 loc) · 6.01 KB
/
Copy pathMakefile
File metadata and controls
138 lines (107 loc) · 6.01 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Makefile — devforge
# Usage: make help
# ── Variables ──────────────────────────────────────────────────────────────────
BINARY_MCP := devforge-mcp
BINARY_TUI := devforge
DIST_DIR := dist
BIN_DIR := bin
VERSION := $(shell cat VERSION 2>/dev/null | tr -d '[:space:]' || echo "0.0.0")
# Install destination
INSTALL_DIR := $(HOME)/.local/bin
# Go build flags
GO_BUILD := go build
GO_TEST := go test
RELEASE_OUT_DIR := $(DIST_DIR)/release
FORMULA_TEMPLATE := packaging/homebrew/Formula/devforge.rb
FORMULA_OUTPUT ?= $(RELEASE_OUT_DIR)/devforge.rb
CHECKSUMS_FILE ?= $(RELEASE_OUT_DIR)/checksums.txt
.DEFAULT_GOAL := help
# ── Phony targets ──────────────────────────────────────────────────────────────
.PHONY: build build-mcp build-tui install uninstall dist \
clean test run tui release-bundle render-homebrew-formula \
install-dpf build-rust build-rust-static help
# ── Build ──────────────────────────────────────────────────────────────────────
## build: Compile both binaries into ./dist/
build: build-mcp build-tui
## build-mcp: Compile the MCP server binary to ./dist/devforge-mcp
build-mcp:
@mkdir -p $(DIST_DIR)
$(GO_BUILD) -o $(DIST_DIR)/$(BINARY_MCP) ./cmd/devforge-mcp/
@echo "Built $(DIST_DIR)/$(BINARY_MCP)"
## build-tui: Compile the CLI/TUI binary to ./dist/devforge
build-tui:
@mkdir -p $(DIST_DIR)
$(GO_BUILD) -o $(DIST_DIR)/$(BINARY_TUI) ./cmd/devforge/
@echo "Built $(DIST_DIR)/$(BINARY_TUI)"
# ── Install ────────────────────────────────────────────────────────────────────
## install: Install to ~/.local/share/devforge/versions/$(VERSION)/ with symlinks in ~/.local/bin/
install:
@bash scripts/install.sh
## uninstall: Remove all devforge binaries, data, and symlinks
uninstall:
@bash scripts/uninstall.sh
# ── Distribution package ───────────────────────────────────────────────────────
## dist: Build binaries and copy dpf into ./dist/
dist: build
@if [ -f $(BIN_DIR)/dpf ]; then \
chmod +x $(BIN_DIR)/dpf; \
cp $(BIN_DIR)/dpf $(DIST_DIR)/dpf; \
fi
@echo "Distribution package ready in $(DIST_DIR)/"
@echo " binary : $(DIST_DIR)/$(BINARY_MCP)"
@echo " binary : $(DIST_DIR)/$(BINARY_TUI)"
## release-bundle: Build the canonical release bundle for the current platform
release-bundle:
@bash scripts/package_release_bundle.sh --version "$(VERSION)" --output-dir "$(RELEASE_OUT_DIR)"
## render-homebrew-formula: Render the release formula from packaging/homebrew/Formula/devforge.rb
render-homebrew-formula:
@python3 scripts/render_homebrew_formula.py \
--template "$(FORMULA_TEMPLATE)" \
--version "$(VERSION)" \
--checksums-file "$(CHECKSUMS_FILE)" \
--output "$(FORMULA_OUTPUT)"
# ── Run ───────────────────────────────────────────────────────────────────────
## run: Build and run the MCP server (stdio transport)
run: build-mcp
@echo "Starting MCP server (stdio transport)..."
./$(DIST_DIR)/$(BINARY_MCP)
## tui: Build and run the CLI/TUI
tui: build-tui
./$(DIST_DIR)/$(BINARY_TUI)
# ── Test ───────────────────────────────────────────────────────────────────────
## test: Run all tests
test:
$(GO_TEST) ./...
# ── DevPixelForge binary (dpf) ─────────────────────────────────────────────────
# The Rust source lives in https://github.com/GustavoGutierrez/devpixelforge
# Use the provided script to download a pre-built release:
## install-dpf: Download the latest DevPixelForge release to bin/dpf
install-dpf:
@bash scripts/install-dpf.sh
## install-dpf VERSION: Download a specific DevPixelForge release to bin/dpf
install-dpf-%:
@bash scripts/install-dpf.sh $*
## build-rust: (Deprecated — clone https://github.com/GustavoGutierrez/devpixelforge and use its Makefile)
build-rust:
@echo "The Rust source is no longer in this repository."
@echo "Clone devpixelforge: git clone https://github.com/GustavoGutierrez/devpixelforge.git"
@echo "Then run 'make build-rust' inside that directory."
## build-rust-static: (Deprecated — clone https://github.com/GustavoGutierrez/devpixelforge and use its Makefile)
build-rust-static:
@echo "The Rust source is no longer in this repository."
@echo "Clone devpixelforge: git clone https://github.com/GustavoGutierrez/devpixelforge.git"
@echo "Then run 'make build-rust-static' inside that directory."
# ── Clean ──────────────────────────────────────────────────────────────────────
## clean: Remove dist/ and compiled binaries
clean:
rm -rf $(DIST_DIR)
@echo "Cleaned $(DIST_DIR)/"
# ── Help ───────────────────────────────────────────────────────────────────────
## help: Show this help message
help:
@echo "devforge — available make targets:"
@echo ""
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/^## / /' | column -t -s ':'
@echo ""
@echo "Variables (override on command line):"
@echo " INSTALL_DIR=$(INSTALL_DIR)"