.PHONY: dev install test demo build clean

VENV ?= .venv
PY   ?= $(VENV)/bin/python

dev: install
	$(PY) -m netguard

install: $(VENV)/bin/python
	$(VENV)/bin/pip install -e .

$(VENV)/bin/python:
	python3 -m venv $(VENV)
	$(VENV)/bin/pip install -U pip

test: install
	$(VENV)/bin/pip install pytest
	$(VENV)/bin/pytest -q

demo: install
	$(PY) -m netguard --audit tests/fixtures/sample_ios_switch_dot1x.cfg

build: install
	$(VENV)/bin/pip install pyinstaller
	$(VENV)/bin/pyinstaller --clean -y build/netguard.spec
	@echo "\n  Built: dist/netguard\n"

clean:
	rm -rf build/__pycache__ dist build/netguard.egg-info .pytest_cache
	find . -name __pycache__ -exec rm -rf {} +
