.PHONY: clean all version whl install pytest tests \
	test_api test_hybrid test_lockstep test_outer

all: tests

######## Setup ########
VERSION = 0.1.1
version: clean
	echo "__version__ = '${VERSION}'" > python/pcg64_cross/__version__.py
	sed --in-place "s/^version = .*/version = \"${VERSION}\"/" Cargo.toml

######## Installation ########
whl: clean version
	maturin build --release --sdist

install: whl
	pip install . --group test

######## Tests ########
test_api: install
	python3 tests/test_api.py

test_hybrid: install
	python3 tests/test_hybrid.py

test_lockstep: install
	python3 tests/test_lockstep.py

test_outer: install
	python3 tests/test_outer.py

pytest: install
	pytest

# Keeping lockstep for performance
tests: pytest test_lockstep

######## Publish ########

pypi: whl install tests
	twine upload target/wheels/*

clean:
	rm -rf target/wheels/*
	rm -rf python/pcg64_cross/*.so

