Files
architecture/Makefile
Hugo Nijhuis 4cb29fa07a refactor: make LLM service management configurable
- Add LLM_SERVICES variable for easy service management
- Add restart-llm-% pattern rule for individual service control
- Refactor restart-llm to loop through services
2026-05-02 11:11:04 +02:00

65 lines
1.9 KiB
Makefile

.PHONY: install uninstall status
CLAUDE_DIR := $(HOME)/.claude
REPO_DIR := $(shell pwd)
# Items to symlink
ITEMS := scripts skills agents settings.json
# LLM services to manage
LLM_SERVICES := atlas forge swift sage
install:
@echo "Installing Claude Code config symlinks..."
@mkdir -p $(CLAUDE_DIR)
@for item in $(ITEMS); do \
if [ -e "$(REPO_DIR)/$$item" ]; then \
if [ -L "$(CLAUDE_DIR)/$$item" ]; then \
echo " $$item: already symlinked"; \
elif [ -e "$(CLAUDE_DIR)/$$item" ]; then \
echo " $$item: backing up existing to $$item.bak"; \
mv "$(CLAUDE_DIR)/$$item" "$(CLAUDE_DIR)/$$item.bak"; \
ln -s "$(REPO_DIR)/$$item" "$(CLAUDE_DIR)/$$item"; \
echo " $$item: symlinked"; \
else \
ln -s "$(REPO_DIR)/$$item" "$(CLAUDE_DIR)/$$item"; \
echo " $$item: symlinked"; \
fi \
fi \
done
@echo "Done! Restart Claude Code to apply changes."
uninstall:
@echo "Removing Claude Code config symlinks..."
@for item in $(ITEMS); do \
if [ -L "$(CLAUDE_DIR)/$$item" ]; then \
rm "$(CLAUDE_DIR)/$$item"; \
echo " $$item: removed symlink"; \
if [ -e "$(CLAUDE_DIR)/$$item.bak" ]; then \
mv "$(CLAUDE_DIR)/$$item.bak" "$(CLAUDE_DIR)/$$item"; \
echo " $$item: restored backup"; \
fi \
fi \
done
@echo "Done!"
status:
@echo "Claude Code config status:"
@for item in $(ITEMS); do \
if [ -L "$(CLAUDE_DIR)/$$item" ]; then \
target=$$(readlink "$(CLAUDE_DIR)/$$item"); \
echo " $$item: symlink -> $$target"; \
elif [ -e "$(CLAUDE_DIR)/$$item" ]; then \
echo " $$item: exists (not symlinked)"; \
else \
echo " $$item: not found"; \
fi \
done
restart-llm-%:
@echo "Restarting com.vllm-mlx-$*..."
@launchctl bootout gui/$$(id -u) ~/Library/LaunchAgents/com.vllm-mlx-$*.plist || true
@launchctl bootstrap gui/$$(id -u) ~/Library/LaunchAgents/com.vllm-mlx-$*.plist
restart-llm: $(patsubst %,restart-llm-%,$(LLM_SERVICES))