.PHONY: help generate lint validate inventory test install-deps clean clean-recipes clean-dishes all

PYTHON ?= python3

default: all

help:
	@echo "Phyllome OS Recipe Generator"
	@echo ""
	@echo "Available targets:"
	@echo "  all          - Generate recipes and dishes, lint, and validate (default)"
	@echo "  generate     - Same as 'all'"
	@echo "  lint         - Lint manifest and templates without writing files"
	@echo "  validate     - Validate existing dishes without regenerating"
	@echo "  inventory    - Print the ingredient inventory derived from recipe_templates.yaml"
	@echo "  test         - Run the pytest test suite"
	@echo "  install-deps - Install Python dependencies"
	@echo "  clean        - Remove generated recipes and dishes"
	@echo "  clean-recipes- Remove generated recipes only"
	@echo "  clean-dishes - Remove generated dishes only"

all: generate

generate:
	@$(PYTHON) generate_recipe.py

lint:
	@$(PYTHON) generate_recipe.py --no-generate --no-validate

validate:
	@$(PYTHON) generate_recipe.py --no-generate --no-lint

inventory:
	@$(PYTHON) generate_recipe.py --inventory

test:
	@$(PYTHON) -m pytest tests

install-deps:
	@pip install -r requirements.txt

clean:
	@rm -f recipes/*.cfg dishes/*.cfg
	@echo "Generated recipes and dishes removed. Run 'make all' to regenerate."

clean-recipes:
	@rm -f recipes/*.cfg
	@echo "Generated recipes removed. Run 'make generate' to regenerate."

clean-dishes:
	@rm -f dishes/*.cfg
	@echo "Generated dishes removed. Run 'make generate' to regenerate."
