2024-09-10 20:34:37 +02:00
|
|
|
# Define the targets
|
2024-09-16 16:11:47 +02:00
|
|
|
.PHONY: help venv pip docker-run docs clean
|
2024-09-10 20:34:37 +02:00
|
|
|
|
|
|
|
# Default target
|
|
|
|
all: help
|
|
|
|
|
|
|
|
# Target to display help information
|
|
|
|
help:
|
|
|
|
@echo "Available targets:"
|
2024-09-16 16:10:46 +02:00
|
|
|
@echo " venv - Set up a Python 3 virtual environment."
|
|
|
|
@echo " pip - Install dependencies from requirements.txt."
|
|
|
|
@echo " docker-run - Run entire setup on docker
|
|
|
|
@echo " docs - Generate HTML documentation using pdoc."
|
|
|
|
@echo " run - Run flask_server.py in the virtual environment."
|
|
|
|
@echo " clean - Remove generated documentation and virtual environment."
|
2024-09-10 20:34:37 +02:00
|
|
|
|
|
|
|
# Target to set up a Python 3 virtual environment
|
|
|
|
venv:
|
|
|
|
python3 -m venv .venv
|
|
|
|
@echo "Virtual environment created in '.venv'. Activate it using 'source .venv/bin/activate'."
|
|
|
|
|
|
|
|
# Target to install dependencies from requirements.txt
|
|
|
|
pip: venv
|
|
|
|
.venv/bin/pip install -r requirements.txt
|
|
|
|
@echo "Dependencies installed from requirements.txt."
|
|
|
|
|
|
|
|
# Target to generate HTML documentation
|
|
|
|
docs: pip
|
|
|
|
pdoc --html --force modules -o docs
|
|
|
|
|
|
|
|
# Clean target to remove generated documentation and virtual environment
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning virtual env and documentation directories"
|
|
|
|
rm -rf docs
|
|
|
|
rm -rf .venv
|
|
|
|
|
|
|
|
run:
|
|
|
|
@echo "Starting flask server, please wait..."
|
|
|
|
.venv/bin/python ./flask_server.py
|
2024-09-16 11:48:20 +02:00
|
|
|
|
|
|
|
# Run entire setup on docker
|
|
|
|
docker-run:
|
2024-09-16 16:13:13 +02:00
|
|
|
@docker compose up
|