# grm version
VERSION = "$(shell grep '^VERSION =' src/grm.py | cut -d '"' -f 2)"

nothing:
	@echo "Use \"make release\" or \"make debug\" to compile the binaries."
	@echo "See the other commands in Makefile."

release:
	@echo "Note: it does the same thing as \"make debug\" but put things in the \"release\" directory."
	@echo ""
	rm -rf build/release
	mkdir -p build/release
	cp src/grm.py build/release
	cp src/bin/grm_to_json.py build/release
	cp helpers/grm-to-json build/release
	cp src/bin/grm_definition_to_json.py build/release
	cp helpers/grm-definition-to-json build/release
	@echo "Scripts generated in build/release"

debug:
	@echo "Note: it does the same thing as \"make release\" but put things in the \"debug\" directory."
	@echo ""
	rm -rf build/debug
	mkdir -p build/debug
	cp src/grm.py build/debug
	cp src/bin/grm_to_json.py build/debug
	cp helpers/grm-to-json build/debug
	cp src/bin/grm_definition_to_json.py build/debug
	cp helpers/grm-definition-to-json build/debug
	@echo "Scripts generated in build/debug"

clean:
	rm -rf build
	rm -rf src/__pycache__
	rm -f tags

doc:
	python3 -m pydoc src/grm.py

fmt:
	black src/bin/*.py src/grm.py

lint:
	pylint \
		--py-version 3.12 \
		--disable C0116,C0301,C0302,R0801,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R1705,R1711 \
		src/bin/*.py src/grm.py

.PHONY: nothing release debug clean lib dist doc lint
