Files
org_web/Makefile
2026-03-19 17:59:15 +00:00

49 lines
1.1 KiB
Makefile
Executable File

.PHONY: all clean norm help
VENV := .venv
PY := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
all: fix-permissions clean-output build search clean-venv
build:
@echo "Building project..."
emacs -Q --script build-site.el
search: $(VENV)
@echo "Generating search index"
$(PY) search-index-json.py
$(VENV):
@echo "Generating virtual environment"
python3 -m venv $(VENV)
$(PIP) install -r requirements.txt
clean-output:
@echo "Cleaning output directory..."
rm -rf output/
clean-venv:
@echo "Cleaning virtual environment..."
rm -rf $(VENV)
norm:
@echo "sorting out the backups..."
find . -path ./backups -prune -o -type f -name '*~' -exec mv {} backups/ \;
fix-permissions:
echo "shakkal123" | sudo -S chown -R zaine:zaine .
# Show help message
help:
@echo "Available targets:"
@echo " make - Full rebuild"
@echo " make build - Rebuild the output directory"
@echo " make clean-output - Remove output directory"
@echo " make clean-venv - Remove venv directory"
@echo " make norm - Move all files that end with ~ to the backup folder"
@echo " make search - creates the search index"
@echo " make help - Show this help message"