PYTHON ?= python

.PHONY: help
help:
	@echo "Targets:"
	@echo "  psych-ch10-problems ... psych-ch20-problems  - run a chapter script"
	@echo "  test-ch10 ... test-ch20                      - run that chapter's tests"
	@echo "  test                                          - run all tests"

.PHONY: test
test:
	pytest -q

# --- Chapter runners ---

.PHONY: psych-ch10-problems
psych-ch10-problems:
	$(PYTHON) scripts/psych_ch10_problem_set.py

.PHONY: test-ch10
test-ch10:
	pytest -q tests/test_psych_ch10_problem_set.py

.PHONY: psych-ch11-problems
psych-ch11-problems:
	$(PYTHON) scripts/psych_ch11_problem_set.py

.PHONY: test-ch11
test-ch11:
	pytest -q tests/test_psych_ch11_problem_set.py

.PHONY: psych-ch12-problems
psych-ch12-problems:
	$(PYTHON) scripts/psych_ch12_problem_set.py

.PHONY: test-ch12
test-ch12:
	pytest -q tests/test_psych_ch12_problem_set.py

.PHONY: psych-ch14-problems
psych-ch14-problems:
	$(PYTHON) scripts/psych_ch14_problem_set.py

.PHONY: test-ch14
test-ch14:
	pytest -q tests/test_psych_ch14_problem_set.py

.PHONY: psych-ch15-problems
psych-ch15-problems:
	$(PYTHON) scripts/psych_ch15_problem_set.py

.PHONY: test-ch15
test-ch15:
	pytest -q tests/test_psych_ch15_problem_set.py

.PHONY: psych-ch16-problems
psych-ch16-problems:
	$(PYTHON) scripts/psych_ch16_problem_set.py

.PHONY: test-ch16
test-ch16:
	pytest -q tests/test_psych_ch16_problem_set.py

.PHONY: psych-ch17-problems
psych-ch17-problems:
	$(PYTHON) scripts/psych_ch17_problem_set.py

.PHONY: test-ch17
test-ch17:
	pytest -q tests/test_psych_ch17_problem_set.py

.PHONY: psych-ch18-problems
psych-ch18-problems:
	$(PYTHON) scripts/psych_ch18_problem_set.py

.PHONY: test-ch18
test-ch18:
	pytest -q tests/test_psych_ch18_problem_set.py

.PHONY: psych-ch19-problems
psych-ch19-problems:
	$(PYTHON) scripts/psych_ch19_problem_set.py

.PHONY: test-ch19
test-ch19:
	pytest -q tests/test_psych_ch19_problem_set.py

.PHONY: psych-ch20-problems
psych-ch20-problems:
	$(PYTHON) scripts/psych_ch20_problem_set.py

.PHONY: test-ch20
test-ch20:
	pytest -q tests/test_psych_ch20_problem_set.py

# --- Case Study: Study Habits (optional make targets) ---

study-habits:
	python scripts/study_habits_01_explore.py
	python scripts/study_habits_02_anova.py

check-study-habits:
	pytest -q tests/test_study_habits_case_study.py
