-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 1.35 KB
/
Makefile
File metadata and controls
38 lines (32 loc) · 1.35 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
.DEFAULT_GOAL := help
# ANSI color codes
CYAN := \033[0;36m
GREEN := \033[0;32m
YELLOW := \033[0;33m
MAGENTA := \033[0;35m
RESET := \033[0m
BOLD := \033[1m
.PHONY: help serve photo-poster
help: ## Show this help message
@echo "$(BOLD)$(MAGENTA)bounds.dev$(RESET) - Available commands:\n"
@echo "$(CYAN)Usage:$(RESET)"
@echo " make $(GREEN)<target>$(RESET)\n"
@echo "$(CYAN)Targets:$(RESET)"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " $(GREEN)%-15s$(RESET) %s\n", $$1, $$2}'
@echo ""
serve: ## Build and serve the site with live reload
@echo "$(YELLOW)Starting Hugo development server...$(RESET)"
@hugo server -D --bind 0.0.0.0
PHOTO_POSTER_DIR := tools/photo-poster
PHOTO_VENV := $(PHOTO_POSTER_DIR)/.venv
PYTHON_BIN ?= python3
photo-poster: ## Run the photo poster tool on port 8000
@lsof -ti:8000 | xargs kill -9 2>/dev/null || true
@if [ ! -d "$(PHOTO_VENV)" ]; then $(PYTHON_BIN) -m venv "$(PHOTO_VENV)"; fi
@PY=""; \
for p in "$(PHOTO_VENV)/bin/python" "$(PHOTO_VENV)/bin/python3" "$(PHOTO_VENV)/bin/python3.11"; do \
if [ -x "$$p" ]; then PY="$$p"; break; fi; \
done; \
if [ -z "$$PY" ]; then echo "Error: No python found in venv"; exit 1; fi; \
PIP_DISABLE_PIP_VERSION_CHECK=1 "$$PY" -m pip install -q -r "$(PHOTO_POSTER_DIR)/requirements.txt"; \
cd "$(PHOTO_POSTER_DIR)" && .venv/bin/python app.py