-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 1 KB
/
Makefile
File metadata and controls
38 lines (32 loc) · 1 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
GOBIN ?= $(shell go env GOPATH)/bin
BINARY = openbotkit
ALIAS = obk
SKILLS_DIR = $(HOME)/.obk/skills
ASSISTANT_SKILLS = assistant/.claude/skills
.PHONY: build build-obkmacos install uninstall update-local
build:
go build -o $(BINARY) .
build-obkmacos:
ifeq ($(shell uname),Darwin)
@mkdir -p $(HOME)/.obk/bin
swiftc -O -o $(HOME)/.obk/bin/obkmacos swift/obkmacos.swift
@echo "Built obkmacos -> $(HOME)/.obk/bin/obkmacos"
endif
install: build-obkmacos
go install .
ln -sf $(GOBIN)/$(BINARY) $(GOBIN)/$(ALIAS)
mkdir -p $(SKILLS_DIR)
$(GOBIN)/$(ALIAS) update --skills-only
@if [ -d assistant ]; then \
rm -f $(ASSISTANT_SKILLS); \
ln -sf $(SKILLS_DIR) $(ASSISTANT_SKILLS); \
echo "Linked $(ASSISTANT_SKILLS) -> $(SKILLS_DIR)"; \
fi
@if pgrep -f "$(BINARY)\|$(ALIAS)" > /dev/null 2>&1; then \
echo "Restarting running services..."; \
$(GOBIN)/$(ALIAS) service restart 2>/dev/null || true; \
fi
update-local: install
$(GOBIN)/$(ALIAS) service restart
uninstall:
rm -f $(GOBIN)/$(BINARY) $(GOBIN)/$(ALIAS)