-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 1.18 KB
/
Makefile
File metadata and controls
34 lines (27 loc) · 1.18 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
.PHONY: build dev-frontend dev-backend macos linux clean
BINDIR ?= /usr/local/bin
SERVICE ?= diffdragon
SYSTEMD_USER_DIR ?= $(HOME)/.config/systemd/user
build:
cd frontend && pnpm install && pnpm build
go build -o diffdragon .
dev-frontend:
cd frontend && pnpm dev
dev-backend:
go run . --base main --ai claude
macos: build
sudo install -m 755 ./diffdragon $(BINDIR)/diffdragon
sudo install -m 755 ./scripts/diffdragon-lmstudio $(BINDIR)/diffdragon-lmstudio
@echo "Installed to $(BINDIR). On macOS, use launchd or manually run the app."
linux: build
sudo install -m 755 ./diffdragon $(BINDIR)/diffdragon
sudo install -m 755 ./scripts/diffdragon-lmstudio $(BINDIR)/diffdragon-lmstudio
mkdir -p $(SYSTEMD_USER_DIR)
printf '%s\n' '[Unit]' 'Description=DiffDragon local service (LM Studio)' '' '[Service]' 'ExecStart=$(BINDIR)/diffdragon-lmstudio' 'Restart=on-failure' 'RestartSec=2' '' '[Install]' 'WantedBy=default.target' > $(SYSTEMD_USER_DIR)/$(SERVICE).service
systemctl --user daemon-reload
systemctl --user enable --now $(SERVICE)
systemctl --user restart $(SERVICE)
systemctl --user --no-pager --lines=6 status $(SERVICE)
clean:
rm -f diffdragon
rm -rf static/assets static/index.html