PYTHON ?= python3 SCRIPT := convert_workshops_to_md.py INDEX_SCRIPT := generate_workshops_index.py WORKSHOPS_DIR := Workshops .PHONY: convert index clean all: convert index convert: @find '$(WORKSHOPS_DIR)' -mindepth 1 -maxdepth 1 -type d \ -exec sh -c 'echo "Processing directory: $$1"; "$$2" "$$3" "$$1"' sh {} '$(PYTHON)' '$(SCRIPT)' \; @$(PYTHON) '$(INDEX_SCRIPT)' '$(WORKSHOPS_DIR)' index: @$(PYTHON) '$(INDEX_SCRIPT)' '$(WORKSHOPS_DIR)' clean: find '$(WORKSHOPS_DIR)' -type f -name '*.md' ! -name 'index.md' -delete rm -f '$(WORKSHOPS_DIR)/index.md'