forked from yongkangc/llmreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (28 loc) · 801 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (28 loc) · 801 Bytes
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
.PHONY: start stop add_book
start:
@if [ ! -d ".venv" ]; then \
echo "No .venv found, running uv sync..."; \
uv sync; \
fi
@echo "Starting server (uv run server.py) ..."
@UV_CACHE_DIR=.uvcache uv run server.py > server.log 2>&1 & echo $$! > .server.pid
@echo "Server started with PID $$(cat .server.pid). Logs: server.log"
stop:
@if [ ! -f .server.pid ]; then \
echo "No .server.pid found; nothing to stop."; \
else \
pid=$$(cat .server.pid); \
if kill $$pid 2>/dev/null; then \
echo "Stopped server PID $$pid"; \
else \
echo "Process $$pid not running"; \
fi; \
rm -f .server.pid; \
fi
add_book:
@if [ -z "$(BOOK)" ]; then \
echo "Usage: make add_book BOOK=/path/to/book.(epub|pdf)"; \
exit 1; \
fi
@echo "Processing $(BOOK) ..."
@uv run reader3.py "$(BOOK)"