-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (35 loc) · 1.26 KB
/
Makefile
File metadata and controls
43 lines (35 loc) · 1.26 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
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X github.com/codemob-ai/codemob/cmd.Version=$(VERSION)"
PREFIX ?= /opt/homebrew
BINDIR := $(PREFIX)/bin
SHAREDIR := $(PREFIX)/share/codemob
.PHONY: build install uninstall test clean release-dry-run
build:
@echo "Building codemob $(VERSION)..."
@go build $(LDFLAGS) -o codemob .
@echo " → ./codemob"
install:
@command -v go >/dev/null 2>&1 || { echo "Error: Go is not installed."; echo ""; echo "Install via Homebrew: brew install go"; echo "Or visit: https://go.dev/dl/"; exit 1; }
@echo "Dev install — emulating Homebrew layout at $(PREFIX)"
@echo ""
@mkdir -p $(BINDIR) $(SHAREDIR)
@echo "Building codemob $(VERSION)..."
@go build $(LDFLAGS) -o $(BINDIR)/codemob .
@cp codemob-shell.sh $(SHAREDIR)/codemob-shell.sh
@echo " → $(BINDIR)/codemob"
@echo " → $(SHAREDIR)/codemob-shell.sh"
@echo ""
@echo "Run 'codemob init' to set up shell integration."
uninstall:
@echo "Removing codemob from $(PREFIX)..."
@rm -f $(BINDIR)/codemob
@rm -rf $(SHAREDIR)
@echo " Done."
test:
@go test ./... -count=1 -v
clean:
@rm -f codemob
@rm -rf dist
@echo " Cleaned build artifacts."
release-dry-run:
@goreleaser release --snapshot --clean