FILES=dupdict_mod.py test-dupdict_mod

go: treap.py py_treap.py red_black_dict_mod.py
	./this-pylint --which-2 None --to-pylint $(FILES)
	# /usr/local/cpython-3.0/bin/python3 test-dupdict_mod
	# /usr/local/cpython-3.1/bin/python3 test-dupdict_mod
	# /usr/local/cpython-3.2/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.3/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.4/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.5/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.6/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.7/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.8/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.9/bin/python3 test-dupdict_mod
	/usr/local/cpython-3.10/bin/python3 test-dupdict_mod
	/usr/local/pypy3-7.3.9/bin/pypy3 test-dupdict_mod

treap.py py_treap.py: treap-dir/m4_treap.m4
	cd treap-dir/pure-python && python setup.py build
	cp treap-dir/pure-python/treap.py .
	cp treap-dir/pure-python/py_treap.py .
	
red_black_dict_mod.py: red_black_tree-dir/red_black_tree_mod.m4
	cd red_black_tree-dir && make
	cp red_black_tree-dir/red_black_dict_mod.py .

register:
	python3 setup.py register

test-publish:
	python3 setup.py sdist bdist_wheel
	twine check dist/*
	twine upload --repository-url https://test.pypi.org/legacy/ dist/*

publish:
	python3 setup.py sdist bdist_wheel
	twine upload dist/*

clean:
	rm -f treap.py py_treap.py red_black_dict_mod.py
	rm -rf __pycache__
	rm -f *.pyc
	cd treap-dir/pure-python && python3 setup.py clean
	cd treap-dir/cython && python3 setup.py clean
	rm -rf treap-dir/build
	rm -rf treap-dir/py_treap.py
	rm -rf treap-dir/pyx_treap.pyx
	cd red_black_tree-dir && make clean
	rm -f *.class
	rm -rf dist dupdict_mod.egg-info