-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (44 loc) · 2.01 KB
/
Copy pathMakefile
File metadata and controls
51 lines (44 loc) · 2.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
# Molibot Makefile
#
# Convenience wrappers around the package scripts. Run `make` (or `make help`) to
# list the available targets.
DESKTOP_DMG_DIR := apps/desktop/src-tauri/target/release/bundle/dmg
# Use Corepack so Make does not depend on a globally installed `pnpm` binary.
# Override when needed, for example: `make desktop-check PNPM=/path/to/pnpm`.
PNPM ?= corepack pnpm
# Data directory holding the singleton service lock/state. Override with
# `make kill-orphans DATA_DIR=~/.molibot-web` if you use a non-default one.
DATA_DIR ?= $(HOME)/.molibot
.DEFAULT_GOAL := help
.PHONY: help
help: ## List available targets
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
.PHONY: dmg
dmg: ## Build the macOS desktop .dmg installer (runtime prep + tauri build + finalize)
$(PNPM) run desktop:build
@echo ""
@echo "DMG ready:"
@ls -lh $(DESKTOP_DMG_DIR)/*.dmg 2>/dev/null || echo " (no .dmg found in $(DESKTOP_DMG_DIR))"
.PHONY: desktop-dev
desktop-dev: ## Build the shared server, then run the desktop app in dev mode
$(PNPM) run desktop:dev
.PHONY: desktop-check
desktop-check: ## Type-check the desktop frontend (svelte-check)
$(PNPM) run desktop:check
.PHONY: kill-orphans
kill-orphans: ## Kill orphaned Molibot server processes and clear the stale service lock
@echo "Looking for orphaned Molibot server / leftover dev processes..."
@pids=$$(ps -axo pid,command | grep -E 'start-server\.mjs|molipibot/node_modules/\.bin/vite dev' | grep -v grep | awk '{print $$1}'); \
if [ -n "$$pids" ]; then \
echo " killing PIDs: $$(echo $$pids | tr '\n' ' ')"; \
echo "$$pids" | xargs -n1 kill -9 2>/dev/null || true; \
else \
echo " none found"; \
fi
@if [ -f "$(DATA_DIR)/runtime/service.lock" ]; then \
rm -f "$(DATA_DIR)/runtime/service.lock" && echo "Removed stale lock: $(DATA_DIR)/runtime/service.lock"; \
else \
echo "No stale lock at $(DATA_DIR)/runtime/service.lock"; \
fi
@echo "Done. Quit Molibot if it is open, then relaunch it."