Newer
Older
NewLang / Makefile
@Jookia Jookia 22 days ago 919 bytes make: Style fixup
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright 2021 Jookia <contact@jookia.org>

SHELL=/bin/bash

build: _build
	test ! -d _build/zip || rm -r _build/zip
	mkdir -p _build/zip
	cp -r src _build/zip
	test ! -d _build/zip/src/__pycache__ || rm -r _build/zip/src/__pycache__
	python3 -m zipapp _build/zip -p "/usr/bin/env python3" -c -m "src.main:main" -o _build/NewLang

clean:
	test ! -d _build || rm -r _build

tidy: _build/.stamp_venv
	source _build/venv/bin/activate && black src tests

grip: _build/.stamp_venv
	source _build/venv/bin/activate && grip

test: _build/.stamp_venv
	source _build/venv/bin/activate && pytest --timeout=30 --timeout_method=thread

venv_bash: _build/.stamp_venv
	source _build/venv/bin/activate && bash

_build:
	mkdir -p _build

_build/.stamp_venv: _build
	python3 -m venv _build/venv
	source _build/venv/bin/activate && pip install -r requirements.txt
	touch _build/.stamp_venv