SHELL := /bin/bash

SLUG ?=
VERSION ?= 1
ROLE ?=

.PHONY: help prepare targets status

help:
	@echo "Usage:"
	@echo "  make prepare SLUG=<cycle-slug> VERSION=<n>"
	@echo "  make targets SLUG=<cycle-slug> ROLE=<role> VERSION=<n>"
	@echo "  make status SLUG=<cycle-slug> VERSION=<n>"
	@echo ""
	@echo "Roles:"
	@echo "  researcher architect author security-reviewer software-reviewer architecture-reviewer ietf-senior-reviewer review-lead"

prepare:
	@if [[ -z "$(SLUG)" ]]; then echo "SLUG is required"; exit 1; fi
	@./scripts/run-cycle.sh "$(SLUG)" "$(VERSION)"

targets:
	@if [[ -z "$(SLUG)" ]]; then echo "SLUG is required"; exit 1; fi
	@if [[ -z "$(ROLE)" ]]; then echo "ROLE is required"; exit 1; fi
	@./scripts/role-target.sh "$(SLUG)" "$(ROLE)" "$(VERSION)"

status:
	@if [[ -z "$(SLUG)" ]]; then echo "SLUG is required"; exit 1; fi
	@./scripts/update-status.sh "$(SLUG)" "$(VERSION)"
