# dev and build helper
# :-
# SPDX-FileCopyrightText: © 2026 Franz Glasner
# SPDX-License-Identifier: MIT
# :-

.PHONY: help all clean distclean dist export build tests flake8 docs clean-docs clean-docs-html pdf clean-pdf install-dev install-docs

help:
	@echo Targets: help, clean, distclean, export, dist, build, tests docs clean-docs

all: tests flake8

build:
	python -m build

dist: distclean build

distclean: clean
	rm -rf dist/ *.egg-info

export:
	rm -rf __arch
	hg kwarchive __arch

clean:
	rm -rf __arch/
	find . -name '*.pyc' -delete

tests:
	-python -m unittest discover -s tests

flake8:
	-flake8 pygments_lexer_pseudocode2
	-flake8 tests

docs:
	(cd docs && make html)

clean-docs:
	(cd docs && make clean)

clean-docs-html:
	rm -rf docs/_build/html

pdf:
	(cd docs && make latex)
	(cd docs/_build/latex && gmake)

clean-pdf:
	rm -rf docs/_build/latex

install-dev:
	python -m pip install -r requirements-dev.txt

install-docs:
	python -m pip install -r requirements-docs.txt
	python -m pip install --editable .
