#go4:
#	./top-4s

# go3: plot.gp

go5: splay_mod.py
	pyflakes splay_mod.py
	pydocstyle splay_mod.py
	pycodestyle --max-line-length=120 splay_mod.py
	
go2: modules
	./this-pylint --which-2 none --to-pylint test-all-db
	./this-pylint --which-2 none --to-pylint test-one memuse_mod.py
	./test-all-db

modules: py_treap.py splay_mod.py red_black_dict_mod.py scapegoat_mod.py binary_tree_dict_mod.py
	
graphs: modules plot.gp numbers
	gnuplot plot.gp

go:
	./this-pylint --which-2 none --to-pylint full-data
	./full-data

summary:
	./full-data > t.html; links -dump -width 132 t.html

plot.gp: gen-gp gen-dats
	./this-pylint --to-pylint gen-dats
	./gen-dats
	./this-pylint --to-pylint common.py gen-gp
	./gen-gp > plot.gp

numbers:
	# This one was giving incorrect results.  Maybe that's the author's fault, maybe it's mine.
	#./this-pylint --to-pylint two_three_tree_mod.py
	./this-pylint --to-pylint py_treap.py
	# We get this in the subdir
	#./this-pylint --to-pylint red_black_dict_mod.py
	./this-pylint --ignore-message '.*Too many lines in module.*' --to-pylint avl_tree_mod.py
	./this-pylint --ignore-message '.*\.insert: Arguments number differs from overridden method.*' --to-pylint btree_mod.py
	#
	./this-pylint --to-pylint test-one common.py
	pep8 --max-line-len 132 test-one common.py
	#./test-one --datastructure treap --pristine --number-pattern sequential --size 131072 --get-percent 5 --set-percent 95
	#./test-one --datastructure treap --prefragment --number-pattern sequential --size 131072 --get-percent 5 --set-percent 95
	#
	./this-pylint --to-pylint test-all-db common.py
	pep8 --max-line-len 132 test-all-db common.py
	./test-all-db
	#
	touch numbers

binary_tree_dict_mod.py: binary-tree-mod/binary_tree_dict_mod.m4
	(set -eu; cd binary-tree-mod; make; cp binary_tree_dict_mod.py ..)

scapegoat_mod.py: scapegoat-tree/scapegoat_mod.m4
	(set -eu; cd scapegoat-tree; make; cp scapegoat_mod.py ..)

red_black_dict_mod.py: red-black-tree-mod/red_black_tree_mod.m4
	(set -eu; cd red-black-tree-mod; make; cp red_black_dict_mod.py ..)

splay_mod.py: splay_mod.m4
	m4 splay_mod.m4 > splay_mod.py

py_treap.py: m4_treap.m4
	m4 -Dm4uniq=True m4_treap.m4 > py_treap.py

very-clean:
	rm -rf *.pyc splay_mod.py py_treap.py *\$$py.class __pycache__ *.pdf *.dat plot.gp red_black_dict_mod.py scapegoat_mod.py binary_tree_dict_mod.py
	cd red-black-tree-mod; make clean
	cd scapegoat-tree; make clean
	cd binary-tree-mod; make clean
	rm -f numbers
	rm -f t.html
	rm -f results results.db results.dir results.pag
	rm -f sortedcontainers/*py.class